Improve example wrt. to CS

Patch provided by anon user.

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@341918 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Christoph Michael Becker 2017-02-17 18:04:34 +00:00
parent cdf488a697
commit f258d65696

View file

@ -69,17 +69,17 @@ if ($a > $b) {
<?php
/* Incorrect Method: */
if($a > $b):
if ($a > $b):
echo $a." is greater than ".$b;
else if($a == $b): // Will not compile.
else if ($a == $b): // Will not compile.
echo "The above line causes a parse error.";
endif;
/* Correct Method: */
if($a > $b):
if ($a > $b):
echo $a." is greater than ".$b;
elseif($a == $b): // Note the combination of the words.
elseif ($a == $b): // Note the combination of the words.
echo $a." equals ".$b;
else:
echo $a." is neither greater than or equal to ".$b;