3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php print('$a = array(0, "a");' . "\n"); $a = array(0,"a"); sort($a); print('sort($a);'); var_dump($a); sort($a); print('sort($a);'); var_dump($a); sort($a); print('sort($a);'); var_dump($a); sort($a); print('sort($a);'); var_dump($a);
based on 8GNVF
Output for 7.0.0 - 7.2.0
$a = array(0, "a"); sort($a);array(2) { [0]=> int(0) [1]=> string(1) "a" } sort($a);array(2) { [0]=> int(0) [1]=> string(1) "a" } sort($a);array(2) { [0]=> int(0) [1]=> string(1) "a" } sort($a);array(2) { [0]=> int(0) [1]=> string(1) "a" }
Output for 5.3.22 - 5.6.28
$a = array(0, "a"); sort($a);array(2) { [0]=> string(1) "a" [1]=> int(0) } sort($a);array(2) { [0]=> int(0) [1]=> string(1) "a" } sort($a);array(2) { [0]=> string(1) "a" [1]=> int(0) } sort($a);array(2) { [0]=> int(0) [1]=> string(1) "a" }