3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $strings = array('SS2014', 'SU2014','FW2014','SS2013','SU2013','FW2013'); $results = array(); sort($strings); echo 'using normal sort'; var_dump($strings); ksort($strings); echo 'using ksort'; var_dump($strings); ntsort($strings); echo 'using ntsort'; var_dump($strings);
Output for 7.0.0 - 7.1.0
using normal sortarray(6) { [0]=> string(6) "FW2013" [1]=> string(6) "FW2014" [2]=> string(6) "SS2013" [3]=> string(6) "SS2014" [4]=> string(6) "SU2013" [5]=> string(6) "SU2014" } using ksortarray(6) { [0]=> string(6) "FW2013" [1]=> string(6) "FW2014" [2]=> string(6) "SS2013" [3]=> string(6) "SS2014" [4]=> string(6) "SU2013" [5]=> string(6) "SU2014" } Fatal error: Uncaught Error: Call to undefined function ntsort() in /in/c3B6d:14 Stack trace: #0 {main} thrown in /in/c3B6d on line 14
Process exited with code 255.
Output for hhvm-3.12.0 - 3.13.2
using normal sortarray(6) { [0]=> string(6) "FW2013" [1]=> string(6) "FW2014" [2]=> string(6) "SS2013" [3]=> string(6) "SS2014" [4]=> string(6) "SU2013" [5]=> string(6) "SU2014" } using ksortarray(6) { [0]=> string(6) "FW2013" [1]=> string(6) "FW2014" [2]=> string(6) "SS2013" [3]=> string(6) "SS2014" [4]=> string(6) "SU2013" [5]=> string(6) "SU2014" } Fatal error: Uncaught Error: Call to undefined function ntsort() in /in/c3B6d:14 Stack trace: #0 {main}
Process exited with code 255.
Output for 5.0.0 - 5.6.26, hhvm-3.10.0
using normal sortarray(6) { [0]=> string(6) "FW2013" [1]=> string(6) "FW2014" [2]=> string(6) "SS2013" [3]=> string(6) "SS2014" [4]=> string(6) "SU2013" [5]=> string(6) "SU2014" } using ksortarray(6) { [0]=> string(6) "FW2013" [1]=> string(6) "FW2014" [2]=> string(6) "SS2013" [3]=> string(6) "SS2014" [4]=> string(6) "SU2013" [5]=> string(6) "SU2014" } Fatal error: Call to undefined function ntsort() in /in/c3B6d on line 14
Process exited with code 255.
Output for 4.4.5 - 4.4.9
using normal sortarray(6) { [0]=> string(6) "FW2013" [1]=> string(6) "FW2014" [2]=> string(6) "SS2013" [3]=> string(6) "SS2014" [4]=> string(6) "SU2013" [5]=> string(6) "SU2014" } using ksortarray(6) { [0]=> string(6) "FW2013" [1]=> string(6) "FW2014" [2]=> string(6) "SS2013" [3]=> string(6) "SS2014" [4]=> string(6) "SU2013" [5]=> string(6) "SU2014" } Fatal error: Call to undefined function: ntsort() in /in/c3B6d on line 14
Process exited with code 255.
Output for 4.3.2 - 4.4.4
using normal sortarray(6) { [0]=> string(6) "FW2013" [1]=> string(6) "FW2014" [2]=> string(6) "SS2013" [3]=> string(6) "SS2014" [4]=> string(6) "SU2013" [5]=> string(6) "SU2014" } using ksortarray(6) { [0]=> string(6) "FW2013" [1]=> string(6) "FW2014" [2]=> string(6) "SS2013" [3]=> string(6) "SS2014" [4]=> string(6) "SU2013" [5]=> string(6) "SU2014" } Fatal error: Call to undefined function: ntsort() in /in/c3B6d on line 14
Process exited with code 255.
Output for 4.3.0 - 4.3.1
using normal sortarray(6) { [0]=> string(6) "FW2013" [1]=> string(6) "FW2014" [2]=> string(6) "SS2013" [3]=> string(6) "SS2014" [4]=> string(6) "SU2013" [5]=> string(6) "SU2014" } using ksortarray(6) { [0]=> string(6) "FW2013" [1]=> string(6) "FW2014" [2]=> string(6) "SS2013" [3]=> string(6) "SS2014" [4]=> string(6) "SU2013" [5]=> string(6) "SU2014" } Fatal error: Call to undefined function: ntsort() in /in/c3B6d on line 14