\n";
$x = 150; $x2 = "150";
$y = 160; $y2 = "160";
$z = 80; $z2 = "80";
$a = "aardvark";
if ($x == $x2)
echo "[int] $x == [string] $x2
"; // yes
if ($x === $x2)
echo "[int] $x === [string] $x2
"; // no
if ($x !== $x2)
echo "[int] $x !== [string] $x2
"; // yes
if ($x < $y)
echo "[int] $x < [int] $y
"; // yes
if ($x < $y2)
echo "[int] $x < [string] $y2
"; // yes (casting)
if ($x < $z)
echo "[int] $x < [int] $z
"; // no (numeric)
if (strcmp($x, $z) < 0)
echo"$x < $z
"; // yes (alpha)
if ((string)$x < (string)$z)
echo "$x < $z
\n"; // no (why???)
else
echo "$x >= $z
\n";
if ($x < $a)
echo "$x < $a
\n"; // no (why???)
else
echo "$x >= $a
\n";
if ((string)$x < $a)
echo "$x < $a
\n"; // yes (why???)
?>
\n";
// Same loop as above but now using the alternative block syntax
for ($i = 1; $i <= 10; $i++):
echo $i;
if ($i < 10) echo ", ";
endfor;
echo "
\n";
?>