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('var13 and var14', $var13, $var14); comparevar('var11 and var14', $var11, $var14); 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 QSoK3
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
var11 and var12: 12345 < 22b var13 and var14: 12345x < 22 var11 and var14: 12345 > 22