Re: foreach() for strings
| From: | Derick Rethans | Date: | Tue, 21 Jun 2011 10:53:56 +0000 |
| Subject: | Re: foreach() for strings | ||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-53470@lists.php.net to get a copy of this message | ||
On Mon, 20 Jun 2011, Stas Malyshev wrote:
> On 6/20/11 9:15 AM, John Crenshaw wrote:
> > > From: Ilia Alshanetsky [mailto:ilia@prohost.org]
> > >
> > > As long as it works on a premise that a "string" is a byte array
> > > and each element represents 1 byte, +1 from me.
> >
> > Code written on this premise is almost always bug central when people
> > finally get around to realizing why they really do need to support
> > wide characters (and everybody does, because people like to paste
> > stuff containing non-break-spaces, and decorative quotes). I really
> > don't think this single byte character mentality should be
> > encouraged.
>
> I think you're right, TextIterator would be better (and also much easier to
> implement, I think). Didn't we have it in Unicode branch? We could port it
> back or we could have something along the lines of grapheme_extract...
It depended on ICU there, and I would be against making a core thing in
PHP 5.x depend on ICU.
cheers,
Derick
--
http://derickrethans.nl | http://xdebug.org
Like Xdebug? Consider a donation: http://xdebug.org/donate.php
twitter: @derickr and @xdebug