3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $foo[1]['items'][] = 'Third'; $foo[0]['items'][] = 'Second'; $foo[4]['items'][] = 'Last'; $foo[-1]['items'][] = 'I will be first'; $foo[0]['items'][] = 'Also second'; asort($foo); echo '<pre>'; var_dump($foo); echo '</pre>';
Output for 4.3.0 - 7.1.0
<pre>array(4) { [-1]=> array(1) { ["items"]=> array(1) { [0]=> string(15) "I will be first" } } [4]=> array(1) { ["items"]=> array(1) { [0]=> string(4) "Last" } } [1]=> array(1) { ["items"]=> array(1) { [0]=> string(5) "Third" } } [0]=> array(1) { ["items"]=> array(2) { [0]=> string(6) "Second" [1]=> string(11) "Also second" } } } </pre>