note 87802 added to language.variables.variable
| From: | milin_mestry at yahoo dot com | Date: | Mon, 22 Dec 2008 12:54:57 +0000 |
| Subject: | note 87802 added to language.variables.variable | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-148454@lists.php.net to get a copy of this message | ||
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 "
----
Server IP: 203.199.69.133
Probable Submitter: 59.162.2.138
----
Manual Page -- http://www.php.net/manual/en/language.variables.variable.php
Edit -- https://master.php.net/note/edit/87802
Del: integrated -- https://master.php.net/note/delete/87802/integrated
Del: useless -- https://master.php.net/note/delete/87802/useless
Del: bad code -- https://master.php.net/note/delete/87802/bad+code
Del: spam -- https://master.php.net/note/delete/87802/spam
Del: non-english -- https://master.php.net/note/delete/87802/non-english
Del: in docs -- https://master.php.net/note/delete/87802/in+docs
Del: other reasons-- https://master.php.net/note/delete/87802
Reject -- https://master.php.net/note/reject/87802
Search -- https://master.php.net/manage/user-notes.php