3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $var11 = '12345'; $var12 = '22b'; $var13 = '12345x'; $var14 = '22'; comparevar('var11 and var12', $var11, $var12); comparevar('var12 and var11', $var12, $var11); comparevar('var13 and var14', $var13, $var14); comparevar('var14 and var13', $var14, $var13); comparevar('var11 and var14', $var11, $var14); comparevar('var12 and var13', $var12, $var13); function comparevar($tag, $arg1, $arg2) { echo("$tag: "); if ($arg1 === $arg2) { say("$arg1 === $arg2"); } if ($arg1 == $arg2) { say("$arg1 == $arg2"); } if ($arg1 < $arg2) { say("$arg1 < $arg2"); } if ($arg1 > $arg2) { say("$arg1 > $arg2"); } } function say($str) { echo $str, "\n"; }
based on pXNOZ
Output for 4.3.0 - 5.6.28, hhvm-3.12.0, 7.0.0 - 7.1.0
var11 and var12: 12345 < 22b var12 and var11: 22b > 12345 var13 and var14: 12345x < 22 var14 and var13: 22 > 12345x var11 and var14: 12345 > 22 var12 and var13: 22b > 12345x
Output for hhvm-3.10.0

Process exited with code 153.