$test=1;
{
$test=2;
}
var_dump($test);
The output of this is 2. I would have expected 1?
What is the point of these curly braces? Do they have some special usage, or it's just allowed syntax that doesn't cause parsing error?
PHP does not support variable scoping using braces (or any other syntax elements). They are just doing nothing in your example.