3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $base = '5.6.1.3b2'; $cmp = '5.6.1'; echo "$base vs $cmp: "; var_dump(version_compare($base, $cmp)); echo "\n\n"; $cmp = '5.6.1.2'; echo "$base vs $cmp: "; var_dump(version_compare($base, $cmp)); echo "\n\n"; $cmp = '5.6.1.3'; echo "$base vs $cmp: "; var_dump(version_compare($base, $cmp)); echo "\n\n"; $cmp = '5.6.1.4'; echo "$base vs $cmp: "; var_dump(version_compare($base, $cmp)); echo "\n\n";
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
5.6.1.3b2 vs 5.6.1: int(1) 5.6.1.3b2 vs 5.6.1.2: int(1) 5.6.1.3b2 vs 5.6.1.3: int(-1) 5.6.1.3b2 vs 5.6.1.4: int(-1)