#41687 [Opn->Bgs]: Array named from other variable doesn't return value for given index
| From: | scottmac@php.net | Date: | Thu, 14 Jun 2007 11:45:44 +0000 |
| Subject: | #41687 [Opn->Bgs]: Array named from other variable doesn't return value for given index | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-113780@lists.php.net to get a copy of this message | ||
ID: 41687
Updated by: scottmac@php.net
Reported By: dr dot diesel at seznam dot cz
-Status: Open
+Status: Bogus
Bug Type: Arrays related
Operating System: Win XP
PHP Version: 5.2.3
New Comment:
Sorry, but your problem does not imply a bug in PHP itself. For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system
is not the
appropriate forum for asking support questions. Due to the volume
of reports we can not explain in detail here why your report is not
a bug. The support channels will be able to provide an explanation
for you.
Thank you for your interest in PHP.
$$arrname[0] becomes $m since $arname[0] is the first character of
$arname.
Previous Comments:
------------------------------------------------------------------------
[2007-06-14 11:29:05] dr dot diesel at seznam dot cz
Sorry, $$arrname = array(204,205); should be the second line.
------------------------------------------------------------------------
[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