|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2001-02-11 15:55 UTC] rasmus@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 22:00:01 2025 UTC |
Defined two variable variables. Expected each to have a different value, both ended up with same value. $counter = 0; $$countrycodefinal = "ctrycode" . $counter; $$aproposfinal = "aproposCitizen" . $counter; echo ${$countrycodefinal} . "<br>"; echo ${$aproposfinal} . "<p>"; I expected the value of $$countrycodefinal to be "ctrycode0" and the value of $aaproposfinal to be "aproposCitizen0", instead BOTH ended up with the value of "aproposCitizen0". I've repeated this several times whenever I use more than one variable variable in the same script.