PHP 4.0 Bug #6470: Variable variables with arrays

From: Date: Thu, 31 Aug 2000 15:27:55 +0000
Subject: PHP 4.0 Bug #6470: Variable variables with arrays
Groups: php.dev 
Request: Send a blank email to php-dev+get-31447@lists.php.net to get a copy of this message
From: drew@elysium.ltd.uk 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

« previous php.dev (#31447) next »