Curly braces
| From: | Neil Parks | Date: | Tue, 27 Apr 2004 16:34:36 +0000 |
| Subject: | Curly braces | ||
| Groups: | php.doc | ||
| Request: | Send a blank email to phpdoc+get-969360290@lists.php.net to get a copy of this message | ||
The following code appears in the PHP Manual to illustrate a "statement group""
<?php
if ($a > $b) {
echo "a is bigger than b";
$b = $a;
}
?>
Frankly, I get confused when curly braces fly all over the place. If I have a series of nested control
structures and statement groups, it becomes very easy to mismatch the braces and create debugging
headaches.
I prefer to have my opening and closing braces in the same column. For example:
<?php
if ($a > $b)
{
echo "a is bigger than b";
$b = $a;
}
?>
That makes them much easier to match up.
Is this syntax permissible? If so, the documentation ought to say so explicitly.
Thank you.