note 87802 rejected from language.variables.variable by thiago
| From: | thiago@php.net | Date: | Mon, 22 Dec 2008 13:10:09 +0000 |
| Subject: | note 87802 rejected from language.variables.variable by thiago | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-148455@lists.php.net to get a copy of this message | ||
Note Submitter: milin_mestry at yahoo dot com
----
error_reporting(E_ALL);
$iNum = 123; //a variable with the value of 123
$$iNum = '456'; // $123 is your variable name, this would normally be invalid.
echo '$$iNum value is ',$$iNum;
The output is:
$$iNum value is 456
Variables must be named using only letters (a-z, A-Z), numbers and the underscore character; their
names must start with either a letter or an underscore, and are one of only two identifier types in
PHP that are case-sensitive.
As per PHP "$123" is an invalid variable, then how the value of "$$iNum" is
printed on the browser without any error?
is this a bug in PHP?
Note: Tested on "PHP Version 5.2.4-2ubuntu5.4, Apache 2.0 Handler "