Newsgroups: php.internals
Path: news.php.net
Xref: news.php.net php.internals:38288
Return-Path: <edwardzyang@thewritingpot.com>
Mailing-List: contact internals-help@lists.php.net; run by ezmlm
Delivered-To: mailing list internals@lists.php.net
Received: (qmail 67600 invoked from network); 16 Jun 2008 14:37:05 -0000
Received: from unknown (HELO lists.php.net) (127.0.0.1)
  by localhost with SMTP; 16 Jun 2008 14:37:05 -0000
X-Host-Fingerprint: 24.228.80.153 ool-18e45099.dyn.optonline.net  
Received: from [24.228.80.153] ([24.228.80.153:18715] helo=localhost.localdomain)
	by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP
	id 28/6B-06776-09A76584 for <internals@lists.php.net>; Mon, 16 Jun 2008 10:37:04 -0400
Message-ID: <28.6B.06776.09A76584@pb1.pair.com>
To: internals@lists.php.net
Date: Mon, 16 Jun 2008 10:37:08 -0400
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.5) Gecko/20041206 Thunderbird/1.0 Mnenhy/0.6.0.104
MIME-Version: 1.0
References: <77972256-ED0C-4FCE-8DEF-8283FE1BBFC5@roshambo.org>	 <484F0897.4040405@fischer.name> <1213139582.12765.5.camel@localhost>	 <698DE66518E7CA45812BD18E807866CE01AB3D1D@us-ex1.zend.net>	 <e2e02fe0806140914l1505d83ft88622c99ef03a11c@mail.gmail.com>	 <9b3df6a50806152320l71581b0dmefe2ccc63766d2e5@mail.gmail.com> <e2e02fe0806160726t33f88a27i69611ecc285f657d@mail.gmail.com>
In-Reply-To: <e2e02fe0806160726t33f88a27i69611ecc285f657d@mail.gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-Posted-By: 24.228.80.153
Subject: Re: [PHP-DEV] deprecation status of $str{42} versus $str[42]
From: edwardzyang@thewritingpot.com ("Edward Z. Yang")

Chris Stockton wrote:
> Seems like you are missing some PHP programming basics. Strings are not an
> array of chars, please go back to making ping pong in java c# or whatever
> other little comp sci classes you took. PHP is not any of them.
> Foreach("foo" as $key => $char) {}, after learning, please be quiet and let
> andi answer my question on his ideas he had for improvements to the existing
> and once favored syntax.

PHP userland code may not treat strings as first class arrays, but
that's certainly how they are represented internally.

Anyway, it would be neat if we could get that foreach syntax to work. I
get sick of for($i = 0, $c = strlen($str); $i < $c; $i++) very quickly.

-- 
 Edward Z. Yang                        GnuPG: 0x869C48DA
 HTML Purifier <http://htmlpurifier.org> Anti-XSS Filter
 [[ 3FA8 E9A9 7385 B691 A6FC B3CB A933 BE7D 869C 48DA ]]