#48121 [NEW]: Reference inconsistency
| From: | feldkamp at gameforge dot de | Date: | Thu, 30 Apr 2009 13:51:57 +0000 |
| Subject: | #48121 [NEW]: Reference inconsistency | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-136576@lists.php.net to get a copy of this message | ||
From: feldkamp at gameforge dot de
Operating system: Debian Etch 2.6.26
PHP version: 5.2.9
PHP Bug Type: Scripting Engine problem
Bug description: Reference inconsistency
Description:
------------
Using array-operator to access a non-existing key of a referenced variable
turns variables that are false or an empty string into arrays.
Reproduce code:
---------------
<?
$abc = false; // or ''
var_dump($abc);
$a = &$abc['unsetKey'];
var_dump($abc);
?>
Expected result:
----------------
Warning: Cannot use a scalar value as an array
Actual result:
--------------
boolean false
array
'unsetKey' => null
--
Edit bug report at http://bugs.php.net/?id=48121&edit=1
--
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=48121&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=48121&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=48121&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=48121&r=fixedcvs
Fixed in CVS and need be documented: http://bugs.php.net/fix.php?id=48121&r=needdocs
Fixed in release: http://bugs.php.net/fix.php?id=48121&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=48121&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=48121&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=48121&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=48121&r=support
Expected behavior: http://bugs.php.net/fix.php?id=48121&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=48121&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=48121&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=48121&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=48121&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=48121&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=48121&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=48121&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=48121&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=48121&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=48121&r=mysqlcfg