0

What do curley braces without any if,while,for etc before them mean in PHP? E.g.

#Code
{
   #Code
}
#Code
JoeS
  • 1,405
  • 17
  • 30

1 Answers1

0

They do/mean precisely nothing - they are only used (very rarely, and usually inappropriately) as a developer aide.

And, if anyone's wondering they don't affect variable scope either:

-> cat foo.php 
<?php

$out = "yup";
{
    echo "can access vars from outside? $out\n";

    $in = "yup";
}

echo "can access vars from inside? $in\n";

-> php foo.php 
can access vars from outside? yup
can access vars from inside? yup
AD7six
  • 63,116
  • 12
  • 91
  • 123
brechmos
  • 1,278
  • 1
  • 11
  • 22