|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2008-08-27 15:30 UTC] 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. PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Nov 27 07:00:01 2025 UTC |
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.