note 52571 added to language.control-structures
| From: | macristo | Date: | Fri, 06 May 2005 07:02:02 +0000 |
| Subject: | note 52571 added to language.control-structures | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-88986@lists.php.net to get a copy of this message | ||
It is not mandatory to use the parentheses in an if-statement.
This is an if-statement on one line and it's perfectly valid code:
<?php
$a = "foo";
if ("foo" == $a) echo "bar";
?>
will output:
"bar"
----
Manual Page -- http://www.php.net/manual/en/language.control-structures.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+52571
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+52571&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+52571&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+52571&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+52571&report=yes&reason=useless
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+52571&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+52571&report=yes
Search -- http://master.php.net/manage/user-notes.php