#48560 [NEW]: E_STRICT does not report error if booleans or ints are used as arrays
From: mk at gigacodes dot de
Operating system: linux
PHP version: 5.3.0RC3
PHP Bug Type: Variables related
Bug description: E_STRICT does not report error if booleans or ints are used as arrays
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 bug report at http://bugs.php.net/?id=48560&edit=1
--
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=48560&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=48560&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=48560&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=48560&r=fixedcvs
Fixed in CVS and need be documented: http://bugs.php.net/fix.php?id=48560&r=needdocs
Fixed in release: http://bugs.php.net/fix.php?id=48560&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=48560&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=48560&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=48560&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=48560&r=support
Expected behavior: http://bugs.php.net/fix.php?id=48560&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=48560&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=48560&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=48560&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=48560&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=48560&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=48560&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=48560&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=48560&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=48560&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=48560&r=mysqlcfg
Thread (5 messages)
- mk at gigacodes dot de