number as variable name impossible? But it works
${4} = 444; echo ${4};
Question: How justified is this syntax? and where is the information about this in the documentation? I have not found.
The syntax is described in Variables . No, you are not "justified" in using this syntax. You should absolutely never do this , there is no good reason for using a number as a variable name.
Variables between parentheses are considered valid (variable variables), regardless of syntax.
${'sad asda sda'} = 444; echo ${'sad asda sda'}; // still works.
it also works
$_4 = 444; echo $_4; //output 444.
This is an absolutely good json line:
$json_str = '{"1": "One", "02": "Two"}';
So, if I decoded it:
$json_object = json_decode($json_str);
way to access items:
$one = $json_object->{1}; $two = $json_object->{"02"};
Source: https://habr.com/ru/post/1437586/More articles:What environment will work fine for a game like Tic Tac Toe on iOS? - iosusing python class methods inside java - javaIn Python 2.7, why grid = [["A"] * 5] * 5 is different from grid = [] grid.append [...] - pythonCan I insert a hidden control into Windows Installer? - windows-installerMongoHub mongo database GUI for Mac no longer works - mongodbAndroid selects custom fonts - androidRegister RS232 on Linux without waiting for a new line - linuxWhen do I need to add a return at the end of a JavaScript function? - javascriptTortoiseGit clone remote branch - gitSQL query joining two columns from two tables into one column of the resulting table? - sqlAll Articles