note 50228 added to function.error-reporting
| From: | vdephily at bluemetrix dot com | Date: | Tue, 22 Feb 2005 11:40:51 +0000 |
| Subject: | note 50228 added to function.error-reporting | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-85370@lists.php.net to get a copy of this message | ||
Note that E_NOTICE will warn you about uninitialized variables, but assigning a key/value pair
counts as initialization, and will not trigger any error :
<?php
error_reporting(E_ALL);
$foo = $bar; //notice : $bar uninitialized
$bar['foo'] = 'hello'; // no notice, although $bar itself has never been
initialized (with "$bar = array()" for example)
$bar = array('foobar' => 'barfoo');
$foo = $bar['foobar'] // ok
$foo = $bar['nope'] // notice : no such index
?>
----
Manual Page -- http://www.php.net/manual/en/function.error-reporting.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+50228
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+50228&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+50228&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+50228&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+50228&report=yes&reason=useless
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+50228&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+50228&report=yes
Search -- http://master.php.net/manage/user-notes.php