#45936 [Opn->Bgs]: Appending undeclared array should generate a notice
| From: | tularis@php.net | Date: | Wed, 27 Aug 2008 18:10:31 +0000 |
| Subject: | #45936 [Opn->Bgs]: Appending undeclared array should generate a notice | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-128480@lists.php.net to get a copy of this message | ||
ID: 45936
Updated by: tularis@php.net
Reported By: php at bouchery dot com
-Status: Open
+Status: Bogus
Bug Type: Feature/Change Request
Operating System: All
PHP Version: 5.2.6
New Comment:
why?
You assign a new array (and its first value) to a variable. What's
wrong with that?
If you see $array[] this as:
$array = array('string');
would you expect it to fire an E_NOTICE ?
no ?
then why would this do so, if it has 100% the same meaning.
Previous Comments:
------------------------------------------------------------------------
[2008-08-27 15:30:47] php at bouchery dot com
Description:
------------
When error_reporting is set to "E_ALL" and trying append an undeclared
array, PHP should generate a "NOTICE" error.
Reproduce code:
---------------
<?php
error_reporting(E_ALL);
$array[] = 'string';
?>
Expected result:
----------------
Notice: Undefined variable: array in /var/www/script.php on line 4
Actual result:
--------------
no error.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=45936&edit=1