Noted that alternative syntax is deprecated.

if:

  statements

else:
  bla

endif;


I read that somewhere, but don't recall where :(


git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@50215 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Jeroen van Wolffelaar 2001-06-26 12:32:47 +00:00
parent 23cd3f0060
commit 6d6899c576

View file

@ -38,7 +38,7 @@ if (expr)
than <replaceable>$b</replaceable>:
<informalexample>
<programlisting role="php">
if ($a > $b)
if ($a &gt; $b)
print "a is bigger than b";
</programlisting>
</informalexample>
@ -54,7 +54,7 @@ if ($a > $b)
<replaceable>$a</replaceable> into <replaceable>$b</replaceable>:
<informalexample>
<programlisting role="php">
if ($a > $b) {
if ($a &gt; $b) {
print "a is bigger than b";
$b = $a;
}
@ -84,7 +84,7 @@ if ($a > $b) {
than b</computeroutput> otherwise:
<informalexample>
<programlisting role="php">
if ($a > $b) {
if ($a &gt; $b) {
print "a is bigger than b";
} else {
print "a is NOT bigger than b";
@ -119,7 +119,7 @@ if ($a > $b) {
or <computeroutput>a is smaller than b</computeroutput>:
<informalexample>
<programlisting role="php">
if ($a > $b) {
if ($a &gt; $b) {
print "a is bigger than b";
} elseif ($a == $b) {
print "a is equal to b";
@ -152,6 +152,18 @@ if ($a > $b) {
<sect1 id="control-structures.alternative-syntax">
<title>Alternative syntax for control structures</title>
<para>
<warning>
<simpara>
Alternative syntax is deprecated as of PHP 4. Basically,
it just generates unreadable code, and it gets
very complicated when mixing it with the normal syntax.
Although there are no plans to break this syntax, it
cannot be ruled out that one day this will stop working.
You are warned.
</simpara>
</warning>
</para>
<para>
PHP offers an alternative syntax for some of its control
structures; namely, <literal>if</literal>,