Extending support for negative string offsets
| From: | flaupretre at free dot fr | Date: | Tue, 21 Jul 2015 21:42:14 +0000 |
| Subject: | Extending support for negative string offsets | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-87226@lists.php.net to get a copy of this message | ||
Hi,
I am starting a PR (https://github.com/php/php-src/pull/1431) to add support for negative string
offsets (counting from the end of the container string) where they could and, IMHO, should be
supported.
The already-published commits add support for negative offsets in '$string{$offset}'
expressions (read and write), something that had been on my todo list for a long time. This one
especially needs review because I'm not so familiar with the engine.
Next changes will add support for functions which don't support negative offsets yet (strpos,
stripos,...). Support for negative lengths may be added too.
Please give thoughts. If return is positive, I'll write an RFC targeting 7.1.
Regards
François