Re: foreach() for strings

From: Date: Mon, 20 Jun 2011 16:49:22 +0000
Subject: Re: foreach() for strings
References: 1 2 3  Groups: php.internals 
Request: Send a blank email to internals+get-53428@lists.php.net to get a copy of this message
Hi! 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...
Also, how do you think this will work with the Unicode conversion in PHP 6? Guaranteed, this will break stuff. Some people will have
I don't think we need to worry about PHP 6 now... If we ever get back to Unicode support, it probably will be different. -- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.com/ (408)454-6900 ext. 227

« previous php.internals (#53428) next »