3v4l.org

run code in 200+ 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 - 7.2.6
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)