Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:38373 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 86163 invoked from network); 19 Jun 2008 00:57:18 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Jun 2008 00:57:18 -0000 Authentication-Results: pb1.pair.com header.from=andrei@gravitonic.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=andrei@gravitonic.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain gravitonic.com from 209.85.198.233 cause and error) X-PHP-List-Original-Sender: andrei@gravitonic.com X-Host-Fingerprint: 209.85.198.233 rv-out-0506.google.com Received: from [209.85.198.233] ([209.85.198.233:34759] helo=rv-out-0506.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id AC/52-03518-DEEA9584 for ; Wed, 18 Jun 2008 20:57:17 -0400 Received: by rv-out-0506.google.com with SMTP id g37so6047713rvb.23 for ; Wed, 18 Jun 2008 17:57:14 -0700 (PDT) Received: by 10.114.27.14 with SMTP id a14mr1719615waa.209.1213837034147; Wed, 18 Jun 2008 17:57:14 -0700 (PDT) Received: from ws-050.prv.corp.outspark.com ( [12.51.40.234]) by mx.google.com with ESMTPS id a8sm14133166poa.12.2008.06.18.17.57.11 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 18 Jun 2008 17:57:13 -0700 (PDT) Message-ID: <4859AEE6.3090001@gravitonic.com> Date: Wed, 18 Jun 2008 17:57:10 -0700 User-Agent: Thunderbird 2.0.0.6 (Macintosh/20070807) MIME-Version: 1.0 To: "Edward Z. Yang" CC: internals@lists.php.net References: <77972256-ED0C-4FCE-8DEF-8283FE1BBFC5@roshambo.org> <484F0897.4040405@fischer.name> <1213139582.12765.5.camel@localhost> <698DE66518E7CA45812BD18E807866CE01AB3D1D@us-ex1.zend.net> <9b3df6a50806152320l71581b0dmefe2ccc63766d2e5@mail.gmail.com> <28.6B.06776.09A76584@pb1.pair.com> <9b3df6a50806162327r52ae3ad9g65d56c0916571185@mail.gmail.com> <4859A244.6050507@gravitonic.com> <3C.91.03518.808A9584@pb1.pair.com> In-Reply-To: <3C.91.03518.808A9584@pb1.pair.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] deprecation status of $str{42} versus $str[42] From: andrei@gravitonic.com (Andrei Zmievski) Yes, and we can have TextIterator work on binary strings as well (perhaps by adding TextIterator::BYTE constant). -Andrei Edward Z. Yang wrote: > Andrei Zmievski wrote: >> Maybe TextIterator can be backported from HEAD, because it allows for >> just that. >> >> foreach (new TextIterator($str) as $c) { >> ... >> } > > IIRC, TextIterator is specifically designed for Unicode, letting you > iterate over codepoints, combining sequences, characters, words, etc. So > making it do all that would only make sense with intl, and even then not > really (as Stanislav points out performance-wise). > > What I was suggesting was a shortcut to iterating over binary data; i.e. > byte by byte. >