Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:57121 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 53302 invoked from network); 27 Dec 2011 14:53:34 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 27 Dec 2011 14:53:34 -0000 Authentication-Results: pb1.pair.com header.from=tyra3l@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=tyra3l@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.216.42 as permitted sender) X-PHP-List-Original-Sender: tyra3l@gmail.com X-Host-Fingerprint: 209.85.216.42 mail-qw0-f42.google.com Received: from [209.85.216.42] ([209.85.216.42:46677] helo=mail-qw0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 0F/F1-41092-DEBD9FE4 for ; Tue, 27 Dec 2011 09:53:33 -0500 Received: by qabj40 with SMTP id j40so6947172qab.8 for ; Tue, 27 Dec 2011 06:53:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=3iI9ZyfKZyw/epqJGX3+7O/jRdfaC3aqewLEsBgQMe0=; b=IrLr+5fQqNeeS/Qz3JHgcnwRudN3/xSYF0v2TNMus8eaySo9KGDcALrDZQFWVWmDjz WCdgkGtMghqI1GC80srHffsazRuwRcJrFzSo/F9FujElulj06PsU1rezU0QqcaGv/0/0 KSAt09M7xfDJNzs6RVfyMIoKn3Ljj87CtbS90= MIME-Version: 1.0 Received: by 10.224.174.71 with SMTP id s7mr8033582qaz.4.1324997610999; Tue, 27 Dec 2011 06:53:30 -0800 (PST) Received: by 10.229.54.140 with HTTP; Tue, 27 Dec 2011 06:53:30 -0800 (PST) In-Reply-To: <00b101ccc49d$4f1e7f10$ed5b7d30$@alliantinternet.com> References: <00aa01ccc499$98aa4dc0$c9fee940$@alliantinternet.com> <00b101ccc49d$4f1e7f10$ed5b7d30$@alliantinternet.com> Date: Tue, 27 Dec 2011 15:53:30 +0100 Message-ID: To: Dmitri Snytkine Cc: Laruence , Pierre Joye , Patrick ALLAERT , Nikita Popov , PHP Internals Content-Type: multipart/alternative; boundary=20cf30334c93ee90e304b5140be9 Subject: Re: [PHP-DEV] [RFC]Call for voting about const array/string dereference From: tyra3l@gmail.com (Ferenc Kovacs) --20cf30334c93ee90e304b5140be9 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Tue, Dec 27, 2011 at 2:42 PM, Dmitri Snytkine < dsnytkine@ultralogistics.com> wrote: > Odd how substring can be used as index of string. oh, I see where the confusion comes from. the reason why "foobar"["foo"] returns 'f' isn't that "foo" is a substring of "foobar", but that "foo" will be casted to int, which will result in "foobar"[0], which in turn will result in 'f' and "foobar"["3 apples"] would return 'b' for example. it's an unexpected behavior for many people, but it is how it works and we even documented this. as I mentioned in my previous mail, we will try to make this a little bit more noisy, as this can lead to hard to spot bugs. --=20 Ferenc Kov=C3=A1cs @Tyr43l - http://tyrael.hu --20cf30334c93ee90e304b5140be9--