3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $array = array( 1 => array( 'weight' => 800, ), 3 => array( 'weight' => 10000, ), 2 => array( 'weight' => 12000, ), 6 => array( 'weight' => 65535, ), 5 => array( 'weight' => 100, ), 4 => array( 'weight' => 1, ), 7 => array( 'weight' => 0, ), 9 => array( 'weight' => 0, ), 11 => array( 'weight' => 0, ), 8 => array( 'weight' => 1, ), 10 => array( 'weight' => 0, ), ); var_dump( $array );
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
array(11) { [1]=> array(1) { ["weight"]=> int(800) } [3]=> array(1) { ["weight"]=> int(10000) } [2]=> array(1) { ["weight"]=> int(12000) } [6]=> array(1) { ["weight"]=> int(65535) } [5]=> array(1) { ["weight"]=> int(100) } [4]=> array(1) { ["weight"]=> int(1) } [7]=> array(1) { ["weight"]=> int(0) } [9]=> array(1) { ["weight"]=> int(0) } [11]=> array(1) { ["weight"]=> int(0) } [8]=> array(1) { ["weight"]=> int(1) } [10]=> array(1) { ["weight"]=> int(0) } }