#28151 [Opn->Bgs]: give notice when storing to an undefined array
| From: | iliaa@php.net | Date: | Mon, 26 Apr 2004 17:30:01 +0000 |
| Subject: | #28151 [Opn->Bgs]: give notice when storing to an undefined array | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-58808@lists.php.net to get a copy of this message | ||
ID: 28151
Updated by: iliaa@php.net
Reported By: aaron dot hawley at uvm dot edu
-Status: Open
+Status: Bogus
Bug Type: Variables related
Operating System: Debian GNU/Linux
PHP Version: 4.3.4
New Comment:
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
Expected behaviour
Previous Comments:
------------------------------------------------------------------------
[2004-04-26 04:56:11] aaron dot hawley at uvm dot edu
don't let the concatenated endline character confuse you.
sorry about that.
------------------------------------------------------------------------
[2004-04-26 04:54:51] aaron dot hawley at uvm dot edu
Description:
------------
When the left-hand-side of an assignment expression is an array
location using square-brackets, PHP should check that the array
variable was previously defined, and give a notice if E_NOTICE is
flagged in error_reporting.
This would find mistyped variables, and help with those attempting to
write more stable and secure PHP code with E_ALL.
Reproduce code:
---------------
<?php
error_reporting(E_ALL);
$not_an_array_yet[1] = 'a' . "\n";
exit("done\n");
?>
Expected result:
----------------
Notice: Undefined variable: not_an_array_yet in my_file.php on line 3
done
Actual result:
--------------
done
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=28151&edit=1