Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:53428 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 35540 invoked from network); 20 Jun 2011 16:49:28 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 20 Jun 2011 16:49:28 -0000 Authentication-Results: pb1.pair.com smtp.mail=smalyshev@sugarcrm.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=smalyshev@sugarcrm.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain sugarcrm.com designates 67.192.241.193 as permitted sender) X-PHP-List-Original-Sender: smalyshev@sugarcrm.com X-Host-Fingerprint: 67.192.241.193 smtp193.dfw.emailsrvr.com Linux 2.6 Received: from [67.192.241.193] ([67.192.241.193:47614] helo=smtp193.dfw.emailsrvr.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 9E/4D-34681-61A7FFD4 for ; Mon, 20 Jun 2011 12:49:28 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp9.relay.dfw1a.emailsrvr.com (SMTP Server) with ESMTP id 72D393C01EB; Mon, 20 Jun 2011 12:49:23 -0400 (EDT) X-Virus-Scanned: OK Received: by smtp9.relay.dfw1a.emailsrvr.com (Authenticated sender: smalyshev-AT-sugarcrm.com) with ESMTPSA id E6DBE3C0407; Mon, 20 Jun 2011 12:49:22 -0400 (EDT) Message-ID: <4DFF7A12.8060808@sugarcrm.com> Date: Mon, 20 Jun 2011 09:49:22 -0700 Organization: SugarCRM User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.17) Gecko/20110414 Thunderbird/3.1.10 MIME-Version: 1.0 To: John Crenshaw CC: Ilia Alshanetsky , Robert Eisele , "internals@lists.php.net" References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] foreach() for strings From: smalyshev@sugarcrm.com (Stas Malyshev) 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