3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php my_version_compare("2.5.1", "2.5.2"); # => -1 (smaller) my_version_compare("2.5.2", "2.5.2"); # => 0 (equal) my_version_compare("2.5.5", "2.5.2"); # => 1 (bigger) my_version_compare("2.5.11", "2.5.2"); # => 1 (bigger, eleven is bigger than two) function my_version_compare($version1, $version2) { var_dump(version_compare($version1, $version2)); }
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
int(-1) int(0) int(1) int(1)