3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $data = array( 'Country' => array( 'United Kingdom' => array( 'London' => array( 0 => 1, 1 => 5, 2 => 23, 3 => 71 ), 'Manchester' => array( 0 => 800 ) ), 'United States' => array( 'New York' => array( 0 => 147, 1 => 111 ), 'Washington' => array( 0 => 213 ), 'Florida' => array( 0 => 6 ), 'Texas' => array( 0 => 9 ) ), 'Brazil' => array( 'Brasília' => array( 0 => 64 ) ) ) ); function ksort_recursive(&$array) { ksort($array); foreach ( $array as &$a ) { is_array($a) && ksort_recursive($a); } } ksort_recursive($data); print_r($data); ?>
Output for 5.0.0 - 5.6.21, hhvm-3.12.0, 7.0.0 - 7.1.0
Array ( [Country] => Array ( [Brazil] => Array ( [Brasília] => Array ( [0] => 64 ) ) [United Kingdom] => Array ( [London] => Array ( [0] => 1 [1] => 5 [2] => 23 [3] => 71 ) [Manchester] => Array ( [0] => 800 ) ) [United States] => Array ( [Florida] => Array ( [0] => 6 ) [New York] => Array ( [0] => 147 [1] => 111 ) [Texas] => Array ( [0] => 9 ) [Washington] => Array ( [0] => 213 ) ) ) )
Output for hhvm-3.10.0

Process exited with code 153.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected '&', expecting T_VARIABLE or '$' in /in/5uBFl on line 42
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected '&', expecting T_VARIABLE or '$' in /in/5uBFl on line 42
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `T_VARIABLE' or `'$'' in /in/5uBFl on line 42
Process exited with code 255.