What is the purpose of a code block that isn't part of an if/function etc
问题 E.g. <?php echo "hello word"; $test = 1; { //sample php code inside code block } ?> Why is sample php code inside that code block. Is it purely to keep any variables defined inside it within the scope of the code block so no variables outside the code block get over written? 回答1: It is most probably just for readability, since it doesn't create a new variable scope or something like this. Also as from the manual: [...]Statements usually end with a semicolon. In addition, statements can be