Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:9580 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 82408 invoked by uid 1010); 27 Apr 2004 09:09:33 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 82384 invoked from network); 27 Apr 2004 09:09:32 -0000 Received: from unknown (HELO xaxa.search.ch) (195.141.85.117) by pb1.pair.com with SMTP; 27 Apr 2004 09:09:32 -0000 Received: from localhost (localhost [127.0.0.1]) by xaxa.search.ch (Postfix) with ESMTP id EAD716CF93; Tue, 27 Apr 2004 11:09:31 +0200 (CEST) Received: by xaxa.search.ch (Postfix, from userid 65534) id DB09D6CFB4; Tue, 27 Apr 2004 11:09:30 +0200 (CEST) Received: from cschneid.com (ultrafilter-i [192.168.85.2]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) by xaxa.search.ch (Postfix) with ESMTP id 31BD16CF93; Tue, 27 Apr 2004 11:09:30 +0200 (CEST) Message-ID: <408E2349.4030303@cschneid.com> Date: Tue, 27 Apr 2004 11:09:29 +0200 User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040114 X-Accept-Language: en-us, en, de-ch, de MIME-Version: 1.0 To: Andi Gutmans Cc: Curt Zirzow , internals@lists.php.net References: <20040427034900.GA31042@bagend.shire> <5.1.0.14.2.20040427104915.02509f58@127.0.0.1> In-Reply-To: <5.1.0.14.2.20040427104915.02509f58@127.0.0.1> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on xaxa.search.ch X-Spam-Level: X-Spam-Status: No, hits=-4.9 required=5.0 tests=BAYES_00 autolearn=ham version=2.63 X-Virus-Scanned: by AMaViS 0.3.12pre8 Subject: Re: [PHP-DEV] Illegal use of string offset From: cschneid@cschneid.com (Christian Schneider) Andi Gutmans wrote: > At 03:49 AM 4/27/2004 +0000, Curt Zirzow wrote: >> $a = 'a string'; >> /* E_ERROR Cannot use string offset as an array */ >> echo is_array($a['bar']['baz']); > > I made this change back in December. > I guess I could revert back but I think it makes sense to be strict here. > What does the rest think? My feeling is that the is_*-functions should be forgiving as people *are* doing checks to ensure proper input values. To force a combination or isset and is_* seems to be the wrong thing to me. But I realize that the issue here happens because is_* are normal functions and the check is done beforehand. Nevertheless I'd prefer not to have to guard is_* with isset in my ideal PHP world :-) On one hand it's not that important to me though as it only happens under rare circumstances. On the other hand it leads to very subtle BC problems as you can hit it depending on user input in a form if you use nested arrays there. So I'm 50:50 on reverting. - Chris