Variable names follow the same rules as other labels in PHP. A valid variable name begins with a letter or underscore, followed by any number of letters, numbers, or underscores. As a regular expression, this would be expressed as follows: [a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*
http://php.net/manual/en/language.variables.basics.php
βOther labelsβ here refer to namespaces, among other things, like class and function names.
Please note that PHP does not have its own understanding of encodings and considers labels like simple byte arrays; most Unicode strings (read: UTF-8) satisfy the above naive regex:
// yup, works namespace ζΌ’ε; class ζε {}
user557846
source share