No notices for undefined index
| From: | Shawn McKenzie | Date: | Thu, 08 Apr 2010 17:36:21 +0000 |
| Subject: | No notices for undefined index | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-303918@lists.php.net to get a copy of this message | ||
So the first two print statements generate NO notices, while the second
obviously generates:
Notice: Undefined offset: 1 in /home/shawn/www/test.php on line 11
Notice: Undefined index: test in /home/shawn/www/test.php on line 12
This sucks. A bug???
error_reporting(E_ALL);
ini_set('display_errors', '1');
$a = 5;
print $a[1];
print $a['test'];
$a = array();
print $a[1];
print $a['test'];
--
Thanks!
-Shawn
http://www.spidean.com