Re: deprecation status of $str{42} versus $str[42]
| From: | Andrei Zmievski | Date: | Thu, 19 Jun 2008 00:03:16 +0000 |
| Subject: | Re: deprecation status of $str{42} versus $str[42] | ||
| References: | 1 2 3 4 5 6 7 8 9 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-38369@lists.php.net to get a copy of this message | ||
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 <edwardzyang@thewritingpot.com>: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