Maybe TextIterator can be backported from HEAD, because it allows for
just that.
foreach (new TextIterator($str) as $c) {
...
}
Arvids Godjuks wrote:
2008/6/16 Edward Z. Yang <[EMAIL PROTECTED]>:
PHP userland code may not treat strings as first class arrays, but
that's certainly how they are represented internally.
Anyway, it would be neat if we could get that foreach syntax to work. I
get sick of for($i = 0, $c = strlen($str); $i < $c; $i++) very quickly.
Totaly agree, the best example from the whole thread
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php