3v4l.org

run code in 300+ PHP versions simultaneously
<?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.51.0", "2.5.2"); # => 1 (bigger, eleven is bigger than two) function my_version_compare($version1, $version2) { echo 'strnatcmp: ', var_dump(strnatcmp($version1, $version2)); echo 'version_compare: ', var_dump(version_compare($version1, $version2)), "\n"; }
Output for git.master, git.master_jit, rfc.property-hooks
strnatcmp: int(-1) version_compare: int(-1) strnatcmp: int(0) version_compare: int(0) strnatcmp: int(1) version_compare: int(1) strnatcmp: int(1) version_compare: int(1)

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
57.02 ms | 401 KiB | 8 Q