Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:6778 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 90097 invoked by uid 1010); 3 Jan 2004 21:41:01 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 89991 invoked from network); 3 Jan 2004 21:41:01 -0000 Received: from unknown (HELO colo.lerdorf.com) (66.198.51.121) by pb1.pair.com with SMTP; 3 Jan 2004 21:41:01 -0000 Received: from [10.0.1.50] (CPE00045a8101f7-CM400045972663.cpe.net.cable.rogers.com [24.112.67.194]) by colo.lerdorf.com (8.12.10/8.12.10/Debian-6) with ESMTP id i03LexQF007926; Sat, 3 Jan 2004 13:41:00 -0800 Date: Sat, 3 Jan 2004 13:40:35 -0800 (PST) X-X-Sender: rasmus@thinkpad.lerdorf.com To: Derick Rethans cc: PHP Developers Mailing List In-Reply-To: Message-ID: References: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Spam-Status: No, hits=-4.8 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=2.61 X-Spam-Checker-Version: SpamAssassin 2.61 (1.212.2.1-2003-12-09-exp) on colo Subject: Re: [PHP-DEV] $a{} stuff From: rasmus@php.net (Rasmus Lerdorf) On Sat, 3 Jan 2004, Derick Rethans wrote: > I think this sideeffect should be disallowed as it adds a lot of > unreadableness to code. (I do als vagely remember a discussion a year or > something ago which resulted in something like "the offset to a string > should be an integer only, and not for example {1..4} or {-1}". Can't > find this though in the archives. That's a different argument. {1..4} and {-1} both introduce new concepts. I see no reason why {} cannot contain exactly the same things that [] can contain today. And if suddenly [] could only contain integers pretty much every PHP script I have ever written would break. The whole point of {} is to explicitly differentiate an string index from an array index. How that index is specified inside the braces shouldn't differ from one to the other. -Rasmus