|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #76553 [RU] Имя переменной может содержать управляющие
Submitted: 2018-06-29 20:59 UTC Modified: 2021-04-28 13:42 UTC
Avg. Score:5.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: byred at mail dot ru Assigned: sergey (profile)
Status: Closed Package: Translation problem
PHP Version: 5.6.36 OS: Win OS
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
46 - 15 = ?
Subscribe to this entry?

 [2018-06-29 20:59 UTC] byred at mail dot ru
From manual page:
Как понимать слова в мануале: "Под буквами здесь подразумеваются символы a-z, A-Z и байты от 127 до 255 (0x7f-0xff). "?

Если в промежутке между 127 и 255 находятся символы вроде: ! + - = и т.п
И в тоже время, можно присвоить имени переменной символ табуляции или другой управляющий символ (см.код)

Test script:
echo '<pre>';
$name = chr(9);
$$name = "somedata";
echo ${'	'}; // tab symblol
echo "\n";

echo '</pre>';


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2018-07-01 00:17 UTC] a at b dot c dot de
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"}.
 [2021-04-28 13:34 UTC]
-Summary: Имя переменной может содержать управляющие +Summary: [RU] Имя переменной может содержать управляющие -Package: Documentation problem +Package: Translation problem -Assigned To: +Assigned To: sergey
 [2021-04-28 13:42 UTC]
-Status: Assigned +Status: Closed
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Tue Nov 29 08:05:54 2022 UTC