3v4l.org

run code in 200+ 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(floatval($version1) >= $version2); }
Output for 4.3.0 - 7.1.7
bool(true) bool(true) bool(true) bool(true)