[PHP-DEV] PHP 4.0 Bug #6470: Variable variables with arrays From: drew <email protected>
Date: 08/31/00

From: drew <email protected>
Operating system: RH 6.2 i386
PHP version: 4.0.2
PHP Bug Type: Other
Bug description: Variable variables with arrays

Is there any reason why this does not work :-

<?
$array = array("key" => "value");
$key = "[key]";

$variable_variable = "array${key}";

$value = $$variable_variable;

print $value;
?>

The only way around this seems to be eval. Not good.

Rgds Drew Wells

-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: php-dev-unsubscribe <email protected>
For additional commands, e-mail: php-dev-help <email protected>
To contact the list administrators, e-mail: php-list-admin <email protected>