Andrei Zmievski wrote: > Maybe TextIterator can be backported from HEAD, because it allows for > just that. > > foreach (new TextIterator($str) as $c) { > ... > }
IIRC, TextIterator is specifically designed for Unicode, letting you iterate over codepoints, combining sequences, characters, words, etc. So making it do all that would only make sense with intl, and even then not really (as Stanislav points out performance-wise). What I was suggesting was a shortcut to iterating over binary data; i.e. byte by byte. -- Edward Z. Yang GnuPG: 0x869C48DA HTML Purifier <http://htmlpurifier.org> Anti-XSS Filter [[ 3FA8 E9A9 7385 B691 A6FC B3CB A933 BE7D 869C 48DA ]] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php