Re: Re: E_NOTICE/E_STRICT/E_WARNING thrown on bad arrays initialization?

From: Date: Sat, 24 Sep 2005 16:26:30 +0000
Subject: Re: Re: E_NOTICE/E_STRICT/E_WARNING thrown on bad arrays initialization?
References: 1 2 3  Groups: php.internals 
Request: Send a blank email to internals+get-19150@lists.php.net to get a copy of this message
Sara Golemon wrote:
As you surely know, arrays are often badly initialized: <?php // $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.
I agree. I've always found it weird that no notice is thrown in this situation. Still I discourage people to code like this.
This was brought up about a year ago and dismissed.
No reason to not bring it up again. Sebastian

« previous php.internals (#19150) next »