Re: [PHP-DEV] Re: [RFC] Generalize support of negative string offsets

2016-01-27 Thread Julien Pauli
On Mon, Jan 25, 2016 at 3:45 PM, François Laupretre wrote: > Hi Andrea, > > Le 23/01/2016 22:10, Andrea Faulds a écrit : >> >> >> Er, ignore what I just said. Negative string offsets are actually >> special-cased and always produce an "Unitialized string offset" or >> "Invalid string offset" notic

Re: [PHP-DEV] Re: [RFC] Generalize support of negative string offsets

2016-01-25 Thread François Laupretre
Hi Andrea, Le 23/01/2016 22:10, Andrea Faulds a écrit : Er, ignore what I just said. Negative string offsets are actually special-cased and always produce an "Unitialized string offset" or "Invalid string offset" notice. So our current behaviour is in fact completely useless, not just mostly. :

[PHP-DEV] Re: [RFC] Generalize support of negative string offsets

2016-01-23 Thread Andrea Faulds
Hi again, Andrea Faulds wrote: At present a negative offset is interpreted as being the maximum string length plus that offset, so $str[-1] is equivalent to $str[(2**64 - 1) - 1]. In practice, this means you will get an empty string and an "Uninitialized string offset:" E_NOTICE. It's not useful

[PHP-DEV] Re: [RFC] Generalize support of negative string offsets

2016-01-23 Thread Andrea Faulds
Hi François, François Laupretre wrote: Starting discussion about https://wiki.php.net/rfc/negative-string-offsets Please read and comment. I like this RFC. Being able to use negative offsets helps code readability, but it not being universally supported is annoying. I like that this brings