Quantcast
Channel: PHPDeveloper.org
Viewing all articles
Browse latest Browse all 2

David Otton's Blog: Stupid PHP Tricks: Illegal Variable Names

0
0

David Otton has shared another of his "stupid PHP tricks" on his blog today. This one looks at illegal variable names that don't match the "can't start with a number" rule the manual points out.

A valid variable name starts with a letter or underscore, followed by any number of letters, numbers, or underscores. As a regular expression, it would be expressed thus: '[a-zA-Z_x7f-xff][a-zA-Z0-9_x7f-xff]*'

Technically, you can get around this in two different ways - variable varaibles and the more complex notation with curly braces. He points to the compact function for proof that they're set.


Viewing all articles
Browse latest Browse all 2

Latest Images

Trending Articles





Latest Images