Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:9737 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 66347 invoked by uid 1010); 8 May 2004 16:41:13 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 66316 invoked by uid 1007); 8 May 2004 16:41:13 -0000 Message-ID: <20040508164113.66315.qmail@pb1.pair.com> To: internals@lists.php.net References: <20040507210516.92262.qmail@pb1.pair.com> <20040507210516.92262.qmail@pb1.pair.com> <5.1.0.14.0.20040507202204.028a1120@mail.ionzoft.com> <5.1.0.14.2.20040508101008.02496d28@127.0.0.1> Date: Sat, 8 May 2004 09:42:50 -0700 Lines: 25 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Posted-By: 64.142.6.231 Subject: Re: [PHP-DEV] Implicit Arrays and E_STRICT From: pollita@php.net ("Sara Golemon") > I don't think any error message should be thrown during implicit array > creation. Not having to define your variables is one of the main principles > of the PHP language. I definitely don't think this should be changed. I > also don't see how this differs very much from a regular assignment to an > undefined variable (e.g. $var = 2; ). > It differs in that if $var is already defined, doing $var = 2; COMPLETELY overwrites it. However if $array is already defined, then $array[] ADDS to it. I see implicit array creation as "bad" in the same way that register_globals is "bad". That is to say, it's not inherently evil, just prone to unexpected behavior when not used correctly. > I think making this an error, even an E_STRICT is a very bad move. > Then we differ on that. Because I think it would be a useful tool for helping the conscientious scripter avoid little, but potentially harmful mistakes. -Sara