3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $arr1 = $arr2 = array("12", "10", "2", "1"); echo "Standard string comparison\n"; usort($arr1, "strcmp"); print_r($arr1); echo "\nNatural order string comparison\n"; usort($arr2, "strnatcmp"); print_r($arr2); ?>
based on Xuoq7
Output for 5.6.0 - 5.6.30, hhvm-3.12.14, hhvm-3.17.3, 7.0.0 - 7.3.0alpha1
Standard string comparison Array ( [0] => 1 [1] => 10 [2] => 12 [3] => 2 ) Natural order string comparison Array ( [0] => 1 [1] => 2 [2] => 10 [3] => 12 )
Output for hhvm-3.15.4

Process exited with code 137.