Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:18667 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 16451 invoked by uid 1010); 4 Sep 2005 11:10:02 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 16436 invoked from network); 4 Sep 2005 11:10:02 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 4 Sep 2005 11:10:02 -0000 X-Host-Fingerprint: 212.238.144.71 korving.demon.nl Received: from ([212.238.144.71:16275] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id 73/1B-33268-806DA134 for ; Sun, 04 Sep 2005 07:10:00 -0400 Message-ID: <73.1B.33268.806DA134@pb1.pair.com> To: internals@lists.php.net References: <431ACE6C.3060006@php.net> Date: Sun, 4 Sep 2005 13:00:34 +0200 Lines: 36 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1437 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 X-Posted-By: 212.238.144.71 Subject: Re: E_NOTICE/E_STRICT/E_WARNING thrown on bad arrays initialization? From: r.korving@xit.nl ("Ron Korving") I agree. I've always found it weird that no notice is thrown in this situation. Still I discourage people to code like this. Ron "Etienne Kneuss" wrote in message news:431ACE6C.3060006@php.net... > Hi, > > As you surely know, arrays are often badly initialized: > > // $array is undefined > $array['index'] = 'value'; > ?> > > Wouldn't it be such a good thing to let the programmers know that this > is a bad habit, by throwing a +/- pedantic error ? I'm not sure which > type would suit for it, but I think its important enough to throw a > E_NOTICE. > > It can be dangerous if the script is ran on an environment where > register_globals is enabled. > I wrote a paper about this kind of leak if you can't imagine an example: > http://www.colder.ch/news/09-04-2005/4/another-example-showing-t.html > > Thanks for your interrest > > -- > Etienne Kneuss > > http://www.colder.ch/ > colder@php.net