Re: Re: foreach() for strings
| From: | Robert Eisele | Date: | Tue, 21 Jun 2011 08:07:40 +0000 |
| Subject: | Re: Re: foreach() for strings | ||
| References: | 1 2 3 4 5 6 7 8 9 10 11 12 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-53461@lists.php.net to get a copy of this message | ||
And what actually failed? The idea seams straightforward.
Robert
2011/6/20 Johannes Schlüter <johannes@schlueters.de>
> On Mon, 2011-06-20 at 20:38 +0200, Robert Eisele wrote:
> > I really like the ideas shared here. It's a thing of consideration that
> > array-functions should also work with strings. Maybe this would be the
> way
> > to go, but I'm more excited about the OOP implementation of TextIterator
> and
> > ByteIterator, which solves the whole problem at once (and is easier to
> > implement, as mentioned by Stas). As Jonathan said, Database results
> with a
> > certain encoding could get iterated, too. The only way to workaround the
> > Text/Byte problem would be, offsetting >EVERY< string with 1-2 byte
> > "string-type" information or an additional type flag in the
> zval-strcuture.
> > Handling everything with zval's instead of objects would have the
> advantage,
> > that database-layers like mysqlnd could write the database-encoding
> directly
> > into the zval and the user had no need to decide what encoding is used.
>
> Welcome back to the failed PHP 6 Unicode project. ;-)
> (while we didn't store the original encoding but converted to Utf-16,
> which prevents random/strange conversions in other places when mixing
> encodings)
>
> johannes
>
>
>