3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php echo $a='5.6.2.1', ' > ', version_compare($a, '5.6.2.2b2'), "\n"; echo $a='5.6.2.2a', ' > ', version_compare($a, '5.6.2.2b2'), "\n"; echo $a='5.6.2.2b', ' > ', version_compare($a, '5.6.2.2b2'), "\n"; echo $a='5.6.2.2b0', ' > ', version_compare($a, '5.6.2.2b2'), "\n"; echo $a='5.6.2.2b1', ' > ', version_compare($a, '5.6.2.2b2'), "\n"; echo $a='5.6.2.2b2', ' > ', version_compare($a, '5.6.2.2b2'), "\n"; echo $a='5.6.2.2b3', ' > ', version_compare($a, '5.6.2.2b2'), "\n"; echo $a='5.6.2.2b10', ' > ', version_compare($a, '5.6.2.2b2'), "\n"; echo $a='5.6.2.2', ' > ', version_compare($a, '5.6.2.2b2'), "\n"; echo $a='5.6.2.3', ' > ', version_compare($a, '5.6.2.2b2'), "\n";
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
5.6.2.1 > -1 5.6.2.2a > -1 5.6.2.2b > -1 5.6.2.2b0 > -1 5.6.2.2b1 > -1 5.6.2.2b2 > 0 5.6.2.2b3 > 1 5.6.2.2b10 > 1 5.6.2.2 > 1 5.6.2.3 > 1