|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-01-20 14:26 UTC] helly@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 16:00:01 2025 UTC |
Description: ------------ With $var{$i} = 'Test' I wanted to create a variable with the name 'var1', using the '{}' and $i == 1, like ${$a} (http://www.php.net/manual/en/language.variables.variable.php) Insted of this, it will create an array, as if I had used '[]' instead of '{}'. Reproduce code: --------------- <?php $i = 1; $var{$i} = 'Test'; echo $var{$i}; echo '<br>'; echo $var{1}; echo '<br>'; echo $var1; ?> Expected result: ---------------- Test<br> Test<br> //not sure, what would happen... Test Actual result: -------------- Test<br> Test<br>