Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:53470 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 11856 invoked from network); 21 Jun 2011 10:54:01 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 21 Jun 2011 10:54:01 -0000 Authentication-Results: pb1.pair.com smtp.mail=derick@php.net; spf=unknown; sender-id=unknown Authentication-Results: pb1.pair.com header.from=derick@php.net; sender-id=unknown Received-SPF: unknown (pb1.pair.com: domain php.net does not designate 82.113.146.227 as permitted sender) X-PHP-List-Original-Sender: derick@php.net X-Host-Fingerprint: 82.113.146.227 xdebug.org Linux 2.6 Received: from [82.113.146.227] ([82.113.146.227:58968] helo=xdebug.org) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id FE/84-18727-748700E4 for ; Tue, 21 Jun 2011 06:54:00 -0400 Received: from localhost (xdebug.org [127.0.0.1]) by xdebug.org (Postfix) with ESMTPS id 760D4DE140; Tue, 21 Jun 2011 11:53:56 +0100 (BST) Date: Tue, 21 Jun 2011 11:53:56 +0100 (BST) X-X-Sender: derick@whisky To: Stas Malyshev cc: John Crenshaw , Ilia Alshanetsky , Robert Eisele , "internals@lists.php.net" In-Reply-To: <4DFF7A12.8060808@sugarcrm.com> Message-ID: References: <4DFF7A12.8060808@sugarcrm.com> User-Agent: Alpine 2.02 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Subject: Re: [PHP-DEV] foreach() for strings From: derick@php.net (Derick Rethans) 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