3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<html> <head> <title> Using comparison operatios </title> </head> <body> <? /* Abdelatif Abu alya 100608856 Feb26th, 2017 WEBD2201 */ $a = 21; $b = 15; echo "<p>original value of \$a is $a and \$b is $b</p>"; if ($a == $b) { echo "<p>Test 1: \$a equals /$b</p>"; } else { echo "<p>Test 1: \$a is not equal /$b</p>"; } if ($a != $b) { echo "<p>Test 2: \$a is not equal to /$b</p>"; } else { echo "<p>Test 2: \$a is equal to /$b</p>"; } if ($a > $b) { echo "<p>Test 3: \$a is grater than /$b</p>"; } else { echo "<p>Test 3: \$a is not grater than /$b</p>"; } if ($a < $b) { echo "<p>Test 4: \$a is less than /$b</p>"; } else { echo "<p>Test 4: \$a is not less than /$b</p>"; } if ($a >= $b) { echo "<p>Test 5: \$a is greater or equal to /$b</p>"; } else { echo "<p>Test 5: \$a is not greater or to equal /$b</p>"; } if ($a <= $b) { echo "<p>Test 6: \$a is less than or equal to /$b</p>"; } else { echo "<p>Test 6: \$a is not less than or to equal /$b</p>"; } ?> </body> </html>
Output for 5.6.0 - 5.6.30, hhvm-3.12.14 - 3.17.3, 7.0.0 - 7.3.0beta1
<html> <head> <title> Using comparison operatios </title> </head> <body> <p>original value of $a is 21 and $b is 15</p><p>Test 1: $a is not equal /15</p><p>Test 2: $a is not equal to /15</p><p>Test 3: $a is grater than /15</p><p>Test 4: $a is not less than /15</p><p>Test 5: $a is greater or equal to /15</p><p>Test 6: $a is not less than or to equal /15</p> </body> </html>