From: mcarpent at zenwerx dot com Operating system: Windows XP PHP version: 5.2.5 PHP Bug Type: Arrays related Bug description: Accessing NULL as an Array does not produce error
Description: ------------ Accessing a null value as an array does not produce an error or even a warning. It resolves to null and the script continues. Reproduce code: --------------- <?php $foo = null; echo "Foo: {$foo['bar']}"; $foo = array(); echo "Foo: {$foo['bar']}"; ?> Expected result: ---------------- Notice: Undefined index: bar in c:\test\test.php on line 4 Foo: Notice: Undefined index: bar in c:\test\test.php on line 7 Foo: Actual result: -------------- Foo: Notice: Undefined index: bar in c:\test\test.php on line 7 Foo: -- Edit bug report at http://bugs.php.net/?id=44821&edit=1 -- Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=44821&r=trysnapshot52 Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=44821&r=trysnapshot53 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=44821&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=44821&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=44821&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=44821&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=44821&r=needscript Try newer version: http://bugs.php.net/fix.php?id=44821&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=44821&r=support Expected behavior: http://bugs.php.net/fix.php?id=44821&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=44821&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=44821&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=44821&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=44821&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=44821&r=dst IIS Stability: http://bugs.php.net/fix.php?id=44821&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=44821&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=44821&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=44821&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=44821&r=mysqlcfg