#48560 [Opn->Ver]: E_STRICT does not report error if booleans or ints are used as arrays
ID: 48560
Updated by: gwynne@php.net
Reported By: mk at gigacodes dot de
-Status: Open
+Status: Verified
Bug Type: Variables related
Operating System: linux
-PHP Version: 5.3.0RC3
+PHP Version: 5.3CVS-2009-06-18 (CVS)
New Comment:
Verified on Darwin9 with 5.3CVS-2009-06-18
Previous Comments:
------------------------------------------------------------------------
[2009-06-15 15:20:23] mk at gigacodes dot de
Description:
------------
when setting error_reporting to E_ALL|E_STRICT accessing undefined
offsets in array $arr is reported. However if $arr is a boolean, int or
null there is no error reported
Reproduce code:
---------------
<?
error_reporting(E_ALL | E_NOTICE | E_STRICT);
#reports undefined variable
echo $xxx;
#does not report error
$xxx = false;
echo $xxx[1];
#reports undefinied offset
$xxx = array();
echo $xxx[1];
?>
Expected result:
----------------
I expect to see 3 errors
Actual result:
--------------
instead i see only 2:
Notice: Undefined variable: xxx
Notice: Undefined offset: 1
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=48560&edit=1
Thread (5 messages)