From:             nikhil dot gupta at in dot ibm dot com
Operating system: Linux, win32-xp
PHP version:      6CVS-2007-05-18 (snap)
PHP Bug Type:     Arrays related
Bug description:  extract() function in php6 does not accept the default prefix 
character ie. "_"

Description:
------------
In PHP6, extract() function doesnot prefix the string with default
character ("_") when no prefix is provided in argument ,as it does in PHP5.

According to php5 documentation, output for testcase with php5 is correct.
i.e when no prefix is provided, default prefix is "_" (underscore
character). Hence while printing the variable _size in php5 , gives correct
output ("medium").

Whereas in php6 it gives a warning and notices and refuses to recognize
the other variables (color, shape) as well as expected prefixed variable
(_size).

Reproduce code:
---------------
<?php
$size = "large";
$var_array = array("color" => "blue",
                   "size"  => "medium",
                   "shape" => "sphere");
extract($var_array, EXTR_PREFIX_SAME, "");
echo "$color, $size, $shape, $_size\n";
?>

Expected result:
----------------
blue, large, sphere, medium

Actual result:
--------------
PHP Warning:  extract(): prefix is not a valid identifier in
/home/nikhil/php/tmp.php on line 7
PHP Notice:  Undefined variable: color in /home/nikhil/php/tmp.php on line
9
PHP Notice:  Undefined variable: shape in /home/nikhil/php/tmp.php on line
9
PHP Notice:  Undefined variable: _size in /home/nikhil/php/tmp.php on line
9
, large, ,

-- 
Edit bug report at http://bugs.php.net/?id=41432&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=41432&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=41432&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=41432&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=41432&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=41432&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=41432&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=41432&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=41432&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=41432&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=41432&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=41432&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=41432&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=41432&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=41432&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=41432&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=41432&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=41432&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=41432&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=41432&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=41432&r=mysqlcfg

Reply via email to