Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:9576 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 11550 invoked by uid 1010); 27 Apr 2004 06:37:22 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 11246 invoked from network); 27 Apr 2004 06:37:19 -0000 Received: from unknown (HELO jdi.jdimedia.nl) (212.204.192.51) by pb1.pair.com with SMTP; 27 Apr 2004 06:37:19 -0000 Received: from localhost (localhost [127.0.0.1]) by jdi.jdimedia.nl (8.12.10/8.12.10) with ESMTP id i3R6bI8C014729; Tue, 27 Apr 2004 08:37:19 +0200 Date: Tue, 27 Apr 2004 08:37:18 +0200 (CEST) X-X-Sender: derick@localhost To: Curt Zirzow cc: internals@lists.php.net In-Reply-To: <20040427034900.GA31042@bagend.shire> Message-ID: References: <20040427034900.GA31042@bagend.shire> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Subject: Re: [PHP-DEV] Illegal use of string offset From: derick@php.net (Derick Rethans) On Tue, 27 Apr 2004, Curt Zirzow wrote: > > I can't seem to find any discussion on this BC issue, so forgive me if > this has already been discussed. > > Given the following; > > $a = 'a string'; > > /* E_ERROR Cannot use string offset as an array */ > echo is_array($a['bar']['baz']); > > /* non error resolution */ > echo isset($a['bar']['baz']) && is_array($a['bar']['baz']); > > > I'm not sure, but the patch below does seem to make the E_ERROR > get demoted to a E_WARNING, thus fixing it so execution simply doesn't > stop when a string is referenced improperly. Or is it a *must* that php > needs to stop in this case? I see no reason why PHP shouldn't stop in this case. You're definitely doing something wrong to create that E_ERROR. Derick