note 119582 added to language.variables.variable
| From: | (ta@ta) | Date: | Mon, 11 Jul 2016 19:32:05 +0000 |
| Subject: | note 119582 added to language.variables.variable | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-205968@lists.php.net to get a copy of this message | ||
While not relevant in everyday PHP programming, it seems to be possible to insert whitespace and
comments between the dollar signs of a variable variable. All three comment styles work. This
information becomes relevant when writing a parser, tokenizer or something else that operates on PHP
syntax.
<?php
$foo = 'bar';
$
/*
I am complete legal and will compile without notices or error as a variable variable.
*/
$foo = 'magic';
echo $bar; // Outputs magic.
?>
Behaviour tested with PHP Version 5.6.19
----
Server IP: 72.52.91.14
Probable Submitter: 85.23.54.84
----
Manual Page -- http://php.net/manual/en/language.variables.variable.php
Edit -- https://master.php.net/note/edit/119582
Del: integrated -- https://master.php.net/note/delete/119582/integrated
Del: useless -- https://master.php.net/note/delete/119582/useless
Del: bad code -- https://master.php.net/note/delete/119582/bad+code
Del: spam -- https://master.php.net/note/delete/119582/spam
Del: non-english -- https://master.php.net/note/delete/119582/non-english
Del: in docs -- https://master.php.net/note/delete/119582/in+docs
Del: other reasons-- https://master.php.net/note/delete/119582
Reject -- https://master.php.net/note/reject/119582
Search -- https://master.php.net/manage/user-notes.php