Variable names
A valid variable name starts with a letter or underscore, followed by any number of letters, numbers, or underscores.
Compare to:
<?php
$a = 1;
$$a = 'foo';
print ${1};
?>So the restriction that the variable name can not start with a number is only enforced by the parser and even then it's fairly easy to circumvent. Maybe it would have been simpler to explain and implement if the definition would be "A valid variable name contains any number of letters, numbers, or underscores".

Comments
Your suggestion?
Would you rather see variables not starting with numbers at all, or allowing variables starting with numbers by the parser as well?
given the state of affairs
add numbers to the parser. it will be a wtf too ($123 looks fun) but a lot smaller wtf.
And more
Try empty strings, unicode, spaces, symbols:
<?php${''} = 'foo';
print ${''};
${'é $"'} = 'bar';
print ${'é $"'};
?>
It all works.
It is so lucky to read your
It is so lucky to read your blog,it is full of useful message.I wish we both can do better in the future.It great honor if you can visit our website,and give us some suggestion.
642-731 dumps
1Y0-A09 dumps
BR0-001 dumps
VCP-511 dumps
70-401 dumps
NS0-153 dumps
156-215-70 dumps
117-202 dumps
Post new comment