echo "Hello, world!";;; ;; ; I always thought that the script would not work, explain why it works?
echo "Hello, world!";;; ;; ; I always thought that the script would not work, explain why it works?
A semicolon separates instructions. Theoretically echo "Hello, world"; looks like that:
{ Вывести строчку "Hello, world!" } That is, there is a block, isolated, instruction that must be executed.
Many commas mean only that in theory it would look like this
{} {} {} A bunch of empty blocks in which there is nothing and nothing to be executed.
And by themselves, {} is a completely legal construction ... To which, as we know, all conditions if or functions of function test() {} , etc. are separated.
For example, you can safely write:
<?php { echo 'Вот оно чё, Михалыч<br />'; $magic = 'Это магия какая-то!'; echo $magic; } ?> And it will work
Source: https://ru.stackoverflow.com/questions/516263/
All Articles