Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:9585 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 32711 invoked by uid 1010); 27 Apr 2004 12:16:36 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 32625 invoked from network); 27 Apr 2004 12:16:36 -0000 Received: from unknown (HELO shiva.mind.de) (212.42.230.204) by pb1.pair.com with SMTP; 27 Apr 2004 12:16:36 -0000 Received: from BAUMBART (pD95F88DE.dip.t-dialin.net [217.95.136.222]) by shiva.mind.de (Postfix) with ESMTP id BF94C97B4F; Tue, 27 Apr 2004 14:16:34 +0200 (CEST) Date: Tue, 27 Apr 2004 14:16:43 +0200 Reply-To: Marcus Boerger X-Priority: 3 (Normal) Message-ID: <271302336.20040427141643@marcus-boerger.de> To: Christian Schneider Cc: Andi Gutmans , Curt Zirzow , internals@lists.php.net In-Reply-To: <408E4557.4010303@cschneid.com> References: <20040427034900.GA31042@bagend.shire> <5.1.0.14.2.20040427104915.02509f58@127.0.0.1> <408E33F4.6050902@cschneid.com> <1719688150.20040427132507@marcus-boerger.de> <408E4557.4010303@cschneid.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Illegal use of string offset From: helly@php.net (Marcus Boerger) Hello Christian, Tuesday, April 27, 2004, 1:34:47 PM, you wrote: > Marcus Boerger wrote: >>>[ $a = 'foo'; $a['bar'] = 42; has an even weirder behaviour: It results >>>in the string '4oo'... ] >> >> That's a pretty. It is using 'bar' as a sting index to 'foo' and to do >> this it needs to convert 'bar' to an integer. The rest is obvious. > So you find it obvious that 42 is cast to string and the first character > is used as replacement? Wasn't obvious to me before I tried it :-) That's what i meant it confuses far too many people and doesn't even make real sense. For example converting 42 into chr(42) and setting it would follow the same autoconversion logic. Hence a hint of kind E_STRICT would be very good. marcus