Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:27218 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 17862 invoked by uid 1010); 30 Dec 2006 16:55:57 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 17847 invoked from network); 30 Dec 2006 16:55:57 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 30 Dec 2006 16:55:57 -0000 Authentication-Results: pb1.pair.com smtp.mail=pollita@php.net; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=pollita@php.net; sender-id=unknown; domainkeys=good Received-SPF: error (pb1.pair.com: domain php.net from 140.211.166.39 cause and error) DomainKey-Status: good X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: pollita@php.net X-Host-Fingerprint: 140.211.166.39 osu1.php.net Linux 2.4/2.6 Received: from [140.211.166.39] ([140.211.166.39:53149] helo=osu1.php.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id B3/E0-05096-D1A96954 for ; Sat, 30 Dec 2006 11:55:57 -0500 X-DomainKeys: Ecelerity dk_sign implementing draft-delany-domainkeys-base-01 DomainKey-Signature: q=dns; a=rsa-sha1; c=nofws; s=mx; d=php.net; h=From:Subject:To:Date; b=a7qPrBCZdt0LnFzkf8qpPu+yNSJESZ+pkCAdLt0fkBV0Tgz95V0mz3Pzu0HHCxFh n7x2YE4Mdu9+diR0u8YEsSktCZt3D6iXiTbhyAONs4yn7VAYE9cpQdbkeT3TRVgt Authentication-Results: osu1.php.net smtp.user=pollita; auth=pass (LOGIN) X-Host-Fingerprint: 216.145.49.15 unknown Received: from [216.145.49.15] ([216.145.49.15:32538] helo=[10.72.76.3]) by osu1.php.net (ecelerity 2.1.1.11-rc1 r(13363/13364M)) with ESMTPSA (cipher=AES256-SHA) id 96/B2-22147-F3A96954 for ; Sat, 30 Dec 2006 08:56:32 -0800 Message-ID: <45969A0C.10503@php.net> Date: Sat, 30 Dec 2006 08:55:40 -0800 User-Agent: Thunderbird 1.5.0.9 (Windows/20061207) MIME-Version: 1.0 To: internals@lists.php.net CC: danielc@analysisandsolutions.com Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: invalid array key/index not generating notices From: pollita@php.net (Sara Golemon) > I came across a subtle bug a developer introduced into our > application. It took us a month to realize the bug was > there because PHP didn't throw a notice. > http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_execute.c?revision=1.755&view=markup Down inside zend_fetch_dimension_address(), you'll find this block: switch(Z_TYPE_P(container)) { /* ... */ case IS_NULL: { /* for read-mode only */ if (result) { result->var.ptr_ptr = &EG(uninitialized_zval_ptr); PZVAL_LOCK(*result->var.ptr_ptr); } if (type==BP_VAR_W || type==BP_VAR_RW) { zend_error(E_WARNING, "Cannot use a NULL value as an array"); } break; } /* ... */ } To me, that screams intentional, and since BC trumps reason, this isn't going to change. -Sara