ID:               41687
 User updated by:  dr dot diesel at seznam dot cz
 Reported By:      dr dot diesel at seznam dot cz
 Status:           Open
 Bug Type:         Arrays related
 Operating System: Win XP
 PHP Version:      5.2.3
 New Comment:

Sorry, $$arrname  = array(204,205); should be the second line.


Previous Comments:
------------------------------------------------------------------------

[2007-06-14 11:26:31] dr dot diesel at seznam dot cz

Description:
------------
Code snippet says everything:

$arrname="my_array";
$$arrname = array("test","test2");

var_export($$arrname) outputs: array ( 0 => '204', 1 => '205', )
var_export($$arrname[0]) outputs: NULL

$test=$$arrname;

var_export($test) outputs: array ( 0 => '204', 1 => '205', )
var_export($test[0]) outputs:'204'

Reproduce code:
---------------
$arrname="my_array";
$$arrname = array("test","test2");

var_export($$arrname); 
var_export($$arrname[0]); 

$test=$$arrname;

var_export($test);
var_export($test[0]);

Expected result:
----------------
$arrname="my_array";
$$arrname = array("test","test2");

var_export($$arrname) outputs: array ( 0 => '204', 1 => '205', )
var_export($$arrname[0]) outputs: >>>>>>>>'204'<<<<<<<<<

$test=$$arrname;

var_export($test) outputs: array ( 0 => '204', 1 => '205', )
var_export($test[0]) outputs:'204'

Actual result:
--------------
$arrname="my_array";
$$arrname = array("test","test2");

var_export($$arrname) outputs: array ( 0 => '204', 1 => '205', )
var_export($$arrname[0]) outputs: NULL

$test=$$arrname;

var_export($test) outputs: array ( 0 => '204', 1 => '205', )
var_export($test[0]) outputs:'204'


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=41687&edit=1

Reply via email to