Andrei Zmievski wrote:
I am not sure how we can optimize [] to be faster than the iterator approach. Food for thought?

You could cache the last position (PHP- and Unicode string index) and start from there. This assumes that most accesses are (more or less) sequential. If you can step backward as well as forward you could use the cached version for both directions but even if you can only go forward it would cover the most common case I guess.

Very simple idea but maybe it helps,
- Chris

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to