|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2018-06-29 20:59 UTC] byred at mail dot ru
Description: ------------ --- From manual page: http://www.php.net/language.variables.basics --- Как понимать слова в мануале: "Под буквами здесь подразумеваются символы a-z, A-Z и байты от 127 до 255 (0x7f-0xff). "? Если в промежутке между 127 и 255 находятся символы вроде: ! + - = и т.п И в тоже время, можно присвоить имени переменной символ табуляции или другой управляющий символ (см.код) Test script: --------------- <?php echo '<pre>'; $name = chr(9); $$name = "somedata"; echo ${' '}; // tab symblol echo "\n"; print_r(get_defined_vars()); echo '</pre>'; ?> PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 10:00:01 2025 UTC |
Well, first of all, the range 127-255 doesn't include any of !, +, -, or = (which have respective byte values, 33, 43, 45, and 61). Second, the distinction is _semantics_ versus _syntax_. *Semantically* variables can have much more elaborate names than can be written *syntactically*. The description given on the page is for the syntax as written in PHP source code. But variables can be created (and named) by methods other than simply being written in source. As your test script shows, you can't actually write a variable as "$ " but instead you have to write something that amounts to defining a string expression and then searching for variable with a matching name. You could also write it as ${"\t"} or ${chr(9)} or ${other arbitrary expression that evaluates to "\t"}.