#46893 [NEW]: extract($foo) fails silently if $foo['foo'] exists
| From: | steffen dot weber at gmail dot com | Date: | Wed, 17 Dec 2008 23:06:57 +0000 |
| Subject: | #46893 [NEW]: extract($foo) fails silently if $foo['foo'] exists | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-132105@lists.php.net to get a copy of this message | ||
From: steffen dot weber at gmail dot com
Operating system: Gentoo Linux x86_64
PHP version: 5.2.8
PHP Bug Type: Arrays related
Bug description: extract($foo) fails silently if $foo['foo'] exists
Description:
------------
Execute the following script and observe that $bar is set to a random
integer (*). Furthermore $test is not set at all. This problem did not
occur with PHP 5.2.6.
(*) Could this have security implications?
Reproduce code:
---------------
<?php
$foo = array('foo' => 1, 'bar' => 2, 'test' => 3);
extract($foo);
var_dump($foo, $bar, $test);
?>
Expected result:
----------------
int(1)
int(2)
int(3)
Actual result:
--------------
Notice: Undefined variable: test in extract-bug.php on line 4
int(1)
int(RANDOM_NUMBER)
NULL
--
Edit bug report at http://bugs.php.net/?id=46893&edit=1
--
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=46893&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=46893&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=46893&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=46893&r=fixedcvs
Fixed in CVS and need be documented: http://bugs.php.net/fix.php?id=46893&r=needdocs
Fixed in release: http://bugs.php.net/fix.php?id=46893&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=46893&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=46893&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=46893&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=46893&r=support
Expected behavior: http://bugs.php.net/fix.php?id=46893&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=46893&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=46893&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=46893&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=46893&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=46893&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=46893&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=46893&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=46893&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=46893&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=46893&r=mysqlcfg