Re: [PHP-DEV] Fixing string offsets of strings.

2011-12-17 Thread Stas Malyshev
Hi! I think the idea behind this patch is good. I'll do final checks and apply it tomorrow if no objections heard until then. Some notes: $s = "string"; isset($s['offset']) returns false This is pretty critical, as it's the only way to detect this situation, and ensure that array tests do n

Re: [PHP-DEV] Fixing string offsets of strings.

2011-12-17 Thread Laruence
On Sun, Dec 18, 2011 at 7:54 AM, Stas Malyshev wrote: > Hi! > > I think the idea behind this patch is good. I'll do final checks and apply > it tomorrow if no objections heard until then. > > Some notes: > > >> $s = "string";  isset($s['offset']) returns false >> This is pretty critical, as it's t

Re: [PHP-DEV] Fixing string offsets of strings.

2011-12-17 Thread Stas Malyshev
Hi! I think only trigger notice when a convertion of string to number index is a good way (trivial bc break). This however doesn't solve the problem with isset() (which still produces true then). BTW, notices there may lead to interruption problems (imagine some error handler that may

Re: Re: [PHP-DEV] Fixing string offsets of strings.

2011-12-17 Thread Alan Knowles
I think I got what you where after - not to clear on the $s['offset'] should result in empty or 'o' This is the latest relivant patch https://bugs.php.net/patch-display.php?bug_id=60362&patch=fix_disabling_bad_string_offsets&revision=latest In that patch $s['offset'] would return an empty str

Re: [PHP-DEV] Fixing string offsets of strings.

2011-12-17 Thread Alan Knowles
This should implement the isset() return false, and accessing producing a warning (but 'less' BC by returning the first character) https://bugs.php.net/patch-display.php?bug_id=60362&patch=isset_changed_warning_only_on_access.patch&revision=latest