3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $data = array( array("type"=>"fruit", "price"=>3.50), array("type"=>"milk", "price"=>2.90), array("type"=>"pork", "price"=>5.43), ); $inventory = $data; $time = microtime(true); array_multisort(array_column($inventory, 'price'), SORT_DESC, $inventory); echo microtime(true)-$time; echo "\n\n"; $new = []; $time = microtime(true); foreach($data as $row){ $new[$row['type']] = $row; } ksort($new); echo microtime(true)-$time; print_r($inventory); print_r($new);
based on ABCgW
Output for 7.2.6
1.0967254638672E-5 1.5974044799805E-5Array ( [0] => Array ( [type] => pork [price] => 5.43 ) [1] => Array ( [type] => fruit [price] => 3.5 ) [2] => Array ( [type] => milk [price] => 2.9 ) ) Array ( [fruit] => Array ( [type] => fruit [price] => 3.5 ) [milk] => Array ( [type] => milk [price] => 2.9 ) [pork] => Array ( [type] => pork [price] => 5.43 ) )
Output for 7.2.0
1.0013580322266E-5 1.5974044799805E-5Array ( [0] => Array ( [type] => pork [price] => 5.43 ) [1] => Array ( [type] => fruit [price] => 3.5 ) [2] => Array ( [type] => milk [price] => 2.9 ) ) Array ( [fruit] => Array ( [type] => fruit [price] => 3.5 ) [milk] => Array ( [type] => milk [price] => 2.9 ) [pork] => Array ( [type] => pork [price] => 5.43 ) )
Output for 7.1.10
5.0067901611328E-6 5.0067901611328E-6Array ( [0] => Array ( [type] => pork [price] => 5.43 ) [1] => Array ( [type] => fruit [price] => 3.5 ) [2] => Array ( [type] => milk [price] => 2.9 ) ) Array ( [fruit] => Array ( [type] => fruit [price] => 3.5 ) [milk] => Array ( [type] => milk [price] => 2.9 ) [pork] => Array ( [type] => pork [price] => 5.43 ) )
Output for 7.1.7
4.0531158447266E-6 7.8678131103516E-6Array ( [0] => Array ( [type] => pork [price] => 5.43 ) [1] => Array ( [type] => fruit [price] => 3.5 ) [2] => Array ( [type] => milk [price] => 2.9 ) ) Array ( [fruit] => Array ( [type] => fruit [price] => 3.5 ) [milk] => Array ( [type] => milk [price] => 2.9 ) [pork] => Array ( [type] => pork [price] => 5.43 ) )
Output for 7.1.6
1.1920928955078E-5 1.3113021850586E-5Array ( [0] => Array ( [type] => pork [price] => 5.43 ) [1] => Array ( [type] => fruit [price] => 3.5 ) [2] => Array ( [type] => milk [price] => 2.9 ) ) Array ( [fruit] => Array ( [type] => fruit [price] => 3.5 ) [milk] => Array ( [type] => milk [price] => 2.9 ) [pork] => Array ( [type] => pork [price] => 5.43 ) )
Output for 7.0.7, 7.1.5
1.5974044799805E-5 1.215934753418E-5Array ( [0] => Array ( [type] => pork [price] => 5.43 ) [1] => Array ( [type] => fruit [price] => 3.5 ) [2] => Array ( [type] => milk [price] => 2.9 ) ) Array ( [fruit] => Array ( [type] => fruit [price] => 3.5 ) [milk] => Array ( [type] => milk [price] => 2.9 ) [pork] => Array ( [type] => pork [price] => 5.43 ) )
Output for 7.1.4
1.3113021850586E-5 1.1920928955078E-5Array ( [0] => Array ( [type] => pork [price] => 5.43 ) [1] => Array ( [type] => fruit [price] => 3.5 ) [2] => Array ( [type] => milk [price] => 2.9 ) ) Array ( [fruit] => Array ( [type] => fruit [price] => 3.5 ) [milk] => Array ( [type] => milk [price] => 2.9 ) [pork] => Array ( [type] => pork [price] => 5.43 ) )
Output for 7.1.3
1.2874603271484E-5 1.2874603271484E-5Array ( [0] => Array ( [type] => pork [price] => 5.43 ) [1] => Array ( [type] => fruit [price] => 3.5 ) [2] => Array ( [type] => milk [price] => 2.9 ) ) Array ( [fruit] => Array ( [type] => fruit [price] => 3.5 ) [milk] => Array ( [type] => milk [price] => 2.9 ) [pork] => Array ( [type] => pork [price] => 5.43 ) )
Output for 7.1.2
1.5974044799805E-5 1.4781951904297E-5Array ( [0] => Array ( [type] => pork [price] => 5.43 ) [1] => Array ( [type] => fruit [price] => 3.5 ) [2] => Array ( [type] => milk [price] => 2.9 ) ) Array ( [fruit] => Array ( [type] => fruit [price] => 3.5 ) [milk] => Array ( [type] => milk [price] => 2.9 ) [pork] => Array ( [type] => pork [price] => 5.43 ) )
Output for 7.1.1
1.1920928955078E-5 1.0967254638672E-5Array ( [0] => Array ( [type] => pork [price] => 5.43 ) [1] => Array ( [type] => fruit [price] => 3.5 ) [2] => Array ( [type] => milk [price] => 2.9 ) ) Array ( [fruit] => Array ( [type] => fruit [price] => 3.5 ) [milk] => Array ( [type] => milk [price] => 2.9 ) [pork] => Array ( [type] => pork [price] => 5.43 ) )
Output for 7.1.0
1.215934753418E-5 1.0967254638672E-5Array ( [0] => Array ( [type] => pork [price] => 5.43 ) [1] => Array ( [type] => fruit [price] => 3.5 ) [2] => Array ( [type] => milk [price] => 2.9 ) ) Array ( [fruit] => Array ( [type] => fruit [price] => 3.5 ) [milk] => Array ( [type] => milk [price] => 2.9 ) [pork] => Array ( [type] => pork [price] => 5.43 ) )
Output for 7.0.20
1.3113021850586E-5 5.0067901611328E-6Array ( [0] => Array ( [type] => pork [price] => 5.43 ) [1] => Array ( [type] => fruit [price] => 3.5 ) [2] => Array ( [type] => milk [price] => 2.9 ) ) Array ( [fruit] => Array ( [type] => fruit [price] => 3.5 ) [milk] => Array ( [type] => milk [price] => 2.9 ) [pork] => Array ( [type] => pork [price] => 5.43 ) )
Output for 7.0.19
1.6927719116211E-5 1.0967254638672E-5Array ( [0] => Array ( [type] => pork [price] => 5.43 ) [1] => Array ( [type] => fruit [price] => 3.5 ) [2] => Array ( [type] => milk [price] => 2.9 ) ) Array ( [fruit] => Array ( [type] => fruit [price] => 3.5 ) [milk] => Array ( [type] => milk [price] => 2.9 ) [pork] => Array ( [type] => pork [price] => 5.43 ) )
Output for 7.0.18
1.5974044799805E-5 1.5020370483398E-5Array ( [0] => Array ( [type] => pork [price] => 5.43 ) [1] => Array ( [type] => fruit [price] => 3.5 ) [2] => Array ( [type] => milk [price] => 2.9 ) ) Array ( [fruit] => Array ( [type] => fruit [price] => 3.5 ) [milk] => Array ( [type] => milk [price] => 2.9 ) [pork] => Array ( [type] => pork [price] => 5.43 ) )
Output for 7.0.17
1.4066696166992E-5 1.215934753418E-5Array ( [0] => Array ( [type] => pork [price] => 5.43 ) [1] => Array ( [type] => fruit [price] => 3.5 ) [2] => Array ( [type] => milk [price] => 2.9 ) ) Array ( [fruit] => Array ( [type] => fruit [price] => 3.5 ) [milk] => Array ( [type] => milk [price] => 2.9 ) [pork] => Array ( [type] => pork [price] => 5.43 ) )
Output for 7.0.16
1.6212463378906E-5 9.0599060058594E-6Array ( [0] => Array ( [type] => pork [price] => 5.43 ) [1] => Array ( [type] => fruit [price] => 3.5 ) [2] => Array ( [type] => milk [price] => 2.9 ) ) Array ( [fruit] => Array ( [type] => fruit [price] => 3.5 ) [milk] => Array ( [type] => milk [price] => 2.9 ) [pork] => Array ( [type] => pork [price] => 5.43 ) )
Output for 7.0.15
1.4066696166992E-5 1.1920928955078E-5Array ( [0] => Array ( [type] => pork [price] => 5.43 ) [1] => Array ( [type] => fruit [price] => 3.5 ) [2] => Array ( [type] => milk [price] => 2.9 ) ) Array ( [fruit] => Array ( [type] => fruit [price] => 3.5 ) [milk] => Array ( [type] => milk [price] => 2.9 ) [pork] => Array ( [type] => pork [price] => 5.43 ) )
Output for 7.0.14
1.5974044799805E-5 4.3869018554688E-5Array ( [0] => Array ( [type] => pork [price] => 5.43 ) [1] => Array ( [type] => fruit [price] => 3.5 ) [2] => Array ( [type] => milk [price] => 2.9 ) ) Array ( [fruit] => Array ( [type] => fruit [price] => 3.5 ) [milk] => Array ( [type] => milk [price] => 2.9 ) [pork] => Array ( [type] => pork [price] => 5.43 ) )
Output for 7.0.10, 7.0.13
1.5020370483398E-5 1.1920928955078E-5Array ( [0] => Array ( [type] => pork [price] => 5.43 ) [1] => Array ( [type] => fruit [price] => 3.5 ) [2] => Array ( [type] => milk [price] => 2.9 ) ) Array ( [fruit] => Array ( [type] => fruit [price] => 3.5 ) [milk] => Array ( [type] => milk [price] => 2.9 ) [pork] => Array ( [type] => pork [price] => 5.43 ) )
Output for 7.0.8, 7.0.12
1.5020370483398E-5 1.215934753418E-5Array ( [0] => Array ( [type] => pork [price] => 5.43 ) [1] => Array ( [type] => fruit [price] => 3.5 ) [2] => Array ( [type] => milk [price] => 2.9 ) ) Array ( [fruit] => Array ( [type] => fruit [price] => 3.5 ) [milk] => Array ( [type] => milk [price] => 2.9 ) [pork] => Array ( [type] => pork [price] => 5.43 ) )
Output for 7.0.11
1.9073486328125E-5 1.3113021850586E-5Array ( [0] => Array ( [type] => pork [price] => 5.43 ) [1] => Array ( [type] => fruit [price] => 3.5 ) [2] => Array ( [type] => milk [price] => 2.9 ) ) Array ( [fruit] => Array ( [type] => fruit [price] => 3.5 ) [milk] => Array ( [type] => milk [price] => 2.9 ) [pork] => Array ( [type] => pork [price] => 5.43 ) )
Output for 7.0.9
1.5974044799805E-5 1.3113021850586E-5Array ( [0] => Array ( [type] => pork [price] => 5.43 ) [1] => Array ( [type] => fruit [price] => 3.5 ) [2] => Array ( [type] => milk [price] => 2.9 ) ) Array ( [fruit] => Array ( [type] => fruit [price] => 3.5 ) [milk] => Array ( [type] => milk [price] => 2.9 ) [pork] => Array ( [type] => pork [price] => 5.43 ) )
Output for 7.0.6
1.5020370483398E-5 1.3113021850586E-5Array ( [0] => Array ( [type] => pork [price] => 5.43 ) [1] => Array ( [type] => fruit [price] => 3.5 ) [2] => Array ( [type] => milk [price] => 2.9 ) ) Array ( [fruit] => Array ( [type] => fruit [price] => 3.5 ) [milk] => Array ( [type] => milk [price] => 2.9 ) [pork] => Array ( [type] => pork [price] => 5.43 ) )
Output for 7.0.5
1.2874603271484E-5 1.4066696166992E-5Array ( [0] => Array ( [type] => pork [price] => 5.43 ) [1] => Array ( [type] => fruit [price] => 3.5 ) [2] => Array ( [type] => milk [price] => 2.9 ) ) Array ( [fruit] => Array ( [type] => fruit [price] => 3.5 ) [milk] => Array ( [type] => milk [price] => 2.9 ) [pork] => Array ( [type] => pork [price] => 5.43 ) )
Output for 7.0.4
1.0967254638672E-5 1.215934753418E-5Array ( [0] => Array ( [type] => pork [price] => 5.43 ) [1] => Array ( [type] => fruit [price] => 3.5 ) [2] => Array ( [type] => milk [price] => 2.9 ) ) Array ( [fruit] => Array ( [type] => fruit [price] => 3.5 ) [milk] => Array ( [type] => milk [price] => 2.9 ) [pork] => Array ( [type] => pork [price] => 5.43 ) )
Output for 5.6.10, 7.0.3
1.0967254638672E-5 1.4066696166992E-5Array ( [0] => Array ( [type] => pork [price] => 5.43 ) [1] => Array ( [type] => fruit [price] => 3.5 ) [2] => Array ( [type] => milk [price] => 2.9 ) ) Array ( [fruit] => Array ( [type] => fruit [price] => 3.5 ) [milk] => Array ( [type] => milk [price] => 2.9 ) [pork] => Array ( [type] => pork [price] => 5.43 ) )
Output for 7.0.0, 7.0.2
1.0967254638672E-5 5.9604644775391E-6Array ( [0] => Array ( [type] => pork [price] => 5.43 ) [1] => Array ( [type] => fruit [price] => 3.5 ) [2] => Array ( [type] => milk [price] => 2.9 ) ) Array ( [fruit] => Array ( [type] => fruit [price] => 3.5 ) [milk] => Array ( [type] => milk [price] => 2.9 ) [pork] => Array ( [type] => pork [price] => 5.43 ) )
Output for 5.6.6, 7.0.1
1.0013580322266E-5 1.1920928955078E-5Array ( [0] => Array ( [type] => pork [price] => 5.43 ) [1] => Array ( [type] => fruit [price] => 3.5 ) [2] => Array ( [type] => milk [price] => 2.9 ) ) Array ( [fruit] => Array ( [type] => fruit [price] => 3.5 ) [milk] => Array ( [type] => milk [price] => 2.9 ) [pork] => Array ( [type] => pork [price] => 5.43 ) )
Output for hhvm-3.15.4
3.0040740966797E-5 2.3126602172852E-5Array ( [0] => Array ( [type] => pork [price] => 5.43 ) [1] => Array ( [type] => fruit [price] => 3.5 ) [2] => Array ( [type] => milk [price] => 2.9 ) ) Array ( [fruit] => Array ( [type] => fruit [price] => 3.5 ) [milk] => Array ( [type] => milk [price] => 2.9 ) [pork] => Array ( [type] => pork [price] => 5.43 ) )
Output for 5.6.8, 5.6.27, 5.6.30
1.0013580322266E-5 1.4066696166992E-5Array ( [0] => Array ( [type] => pork [price] => 5.43 ) [1] => Array ( [type] => fruit [price] => 3.5 ) [2] => Array ( [type] => milk [price] => 2.9 ) ) Array ( [fruit] => Array ( [type] => fruit [price] => 3.5 ) [milk] => Array ( [type] => milk [price] => 2.9 ) [pork] => Array ( [type] => pork [price] => 5.43 ) )
Output for 5.6.29
7.8678131103516E-6 1.5020370483398E-5Array ( [0] => Array ( [type] => pork [price] => 5.43 ) [1] => Array ( [type] => fruit [price] => 3.5 ) [2] => Array ( [type] => milk [price] => 2.9 ) ) Array ( [fruit] => Array ( [type] => fruit [price] => 3.5 ) [milk] => Array ( [type] => milk [price] => 2.9 ) [pork] => Array ( [type] => pork [price] => 5.43 ) )
Output for 5.6.28
1.0013580322266E-5 1.8835067749023E-5Array ( [0] => Array ( [type] => pork [price] => 5.43 ) [1] => Array ( [type] => fruit [price] => 3.5 ) [2] => Array ( [type] => milk [price] => 2.9 ) ) Array ( [fruit] => Array ( [type] => fruit [price] => 3.5 ) [milk] => Array ( [type] => milk [price] => 2.9 ) [pork] => Array ( [type] => pork [price] => 5.43 ) )
Output for 5.6.20, 5.6.26
1.0967254638672E-5 1.3113021850586E-5Array ( [0] => Array ( [type] => pork [price] => 5.43 ) [1] => Array ( [type] => fruit [price] => 3.5 ) [2] => Array ( [type] => milk [price] => 2.9 ) ) Array ( [fruit] => Array ( [type] => fruit [price] => 3.5 ) [milk] => Array ( [type] => milk [price] => 2.9 ) [pork] => Array ( [type] => pork [price] => 5.43 ) )
Output for 5.6.25
1.0013580322266E-5 1.3828277587891E-5Array ( [0] => Array ( [type] => pork [price] => 5.43 ) [1] => Array ( [type] => fruit [price] => 3.5 ) [2] => Array ( [type] => milk [price] => 2.9 ) ) Array ( [fruit] => Array ( [type] => fruit [price] => 3.5 ) [milk] => Array ( [type] => milk [price] => 2.9 ) [pork] => Array ( [type] => pork [price] => 5.43 ) )
Output for 5.6.24
9.0599060058594E-6 1.9073486328125E-5Array ( [0] => Array ( [type] => pork [price] => 5.43 ) [1] => Array ( [type] => fruit [price] => 3.5 ) [2] => Array ( [type] => milk [price] => 2.9 ) ) Array ( [fruit] => Array ( [type] => fruit [price] => 3.5 ) [milk] => Array ( [type] => milk [price] => 2.9 ) [pork] => Array ( [type] => pork [price] => 5.43 ) )
Output for 5.6.23
1.1920928955078E-5 1.7881393432617E-5Array ( [0] => Array ( [type] => pork [price] => 5.43 ) [1] => Array ( [type] => fruit [price] => 3.5 ) [2] => Array ( [type] => milk [price] => 2.9 ) ) Array ( [fruit] => Array ( [type] => fruit [price] => 3.5 ) [milk] => Array ( [type] => milk [price] => 2.9 ) [pork] => Array ( [type] => pork [price] => 5.43 ) )
Output for 5.6.12, 5.6.22
1.215934753418E-5 1.6927719116211E-5Array ( [0] => Array ( [type] => pork [price] => 5.43 ) [1] => Array ( [type] => fruit [price] => 3.5 ) [2] => Array ( [type] => milk [price] => 2.9 ) ) Array ( [fruit] => Array ( [type] => fruit [price] => 3.5 ) [milk] => Array ( [type] => milk [price] => 2.9 ) [pork] => Array ( [type] => pork [price] => 5.43 ) )
Output for 5.6.21
1.0013580322266E-5 1.215934753418E-5Array ( [0] => Array ( [type] => pork [price] => 5.43 ) [1] => Array ( [type] => fruit [price] => 3.5 ) [2] => Array ( [type] => milk [price] => 2.9 ) ) Array ( [fruit] => Array ( [type] => fruit [price] => 3.5 ) [milk] => Array ( [type] => milk [price] => 2.9 ) [pork] => Array ( [type] => pork [price] => 5.43 ) )
Output for 5.6.17, 5.6.19
9.0599060058594E-6 1.2874603271484E-5Array ( [0] => Array ( [type] => pork [price] => 5.43 ) [1] => Array ( [type] => fruit [price] => 3.5 ) [2] => Array ( [type] => milk [price] => 2.9 ) ) Array ( [fruit] => Array ( [type] => fruit [price] => 3.5 ) [milk] => Array ( [type] => milk [price] => 2.9 ) [pork] => Array ( [type] => pork [price] => 5.43 ) )
Output for 5.6.11, 5.6.13, 5.6.18
1.0013580322266E-5 1.2874603271484E-5Array ( [0] => Array ( [type] => pork [price] => 5.43 ) [1] => Array ( [type] => fruit [price] => 3.5 ) [2] => Array ( [type] => milk [price] => 2.9 ) ) Array ( [fruit] => Array ( [type] => fruit [price] => 3.5 ) [milk] => Array ( [type] => milk [price] => 2.9 ) [pork] => Array ( [type] => pork [price] => 5.43 ) )
Output for 5.6.14, 5.6.16
9.0599060058594E-6 1.3113021850586E-5Array ( [0] => Array ( [type] => pork [price] => 5.43 ) [1] => Array ( [type] => fruit [price] => 3.5 ) [2] => Array ( [type] => milk [price] => 2.9 ) ) Array ( [fruit] => Array ( [type] => fruit [price] => 3.5 ) [milk] => Array ( [type] => milk [price] => 2.9 ) [pork] => Array ( [type] => pork [price] => 5.43 ) )
Output for 5.6.4, 5.6.7, 5.6.15
1.0013580322266E-5 1.3113021850586E-5Array ( [0] => Array ( [type] => pork [price] => 5.43 ) [1] => Array ( [type] => fruit [price] => 3.5 ) [2] => Array ( [type] => milk [price] => 2.9 ) ) Array ( [fruit] => Array ( [type] => fruit [price] => 3.5 ) [milk] => Array ( [type] => milk [price] => 2.9 ) [pork] => Array ( [type] => pork [price] => 5.43 ) )
Output for 5.6.9
9.7751617431641E-6 1.2874603271484E-5Array ( [0] => Array ( [type] => pork [price] => 5.43 ) [1] => Array ( [type] => fruit [price] => 3.5 ) [2] => Array ( [type] => milk [price] => 2.9 ) ) Array ( [fruit] => Array ( [type] => fruit [price] => 3.5 ) [milk] => Array ( [type] => milk [price] => 2.9 ) [pork] => Array ( [type] => pork [price] => 5.43 ) )
Output for 5.6.5
9.0599060058594E-6 2.8133392333984E-5Array ( [0] => Array ( [type] => pork [price] => 5.43 ) [1] => Array ( [type] => fruit [price] => 3.5 ) [2] => Array ( [type] => milk [price] => 2.9 ) ) Array ( [fruit] => Array ( [type] => fruit [price] => 3.5 ) [milk] => Array ( [type] => milk [price] => 2.9 ) [pork] => Array ( [type] => pork [price] => 5.43 ) )
Output for 5.6.3
1.215934753418E-5 1.3113021850586E-5Array ( [0] => Array ( [type] => pork [price] => 5.43 ) [1] => Array ( [type] => fruit [price] => 3.5 ) [2] => Array ( [type] => milk [price] => 2.9 ) ) Array ( [fruit] => Array ( [type] => fruit [price] => 3.5 ) [milk] => Array ( [type] => milk [price] => 2.9 ) [pork] => Array ( [type] => pork [price] => 5.43 ) )
Output for 5.6.2
1.215934753418E-5 1.5974044799805E-5Array ( [0] => Array ( [type] => pork [price] => 5.43 ) [1] => Array ( [type] => fruit [price] => 3.5 ) [2] => Array ( [type] => milk [price] => 2.9 ) ) Array ( [fruit] => Array ( [type] => fruit [price] => 3.5 ) [milk] => Array ( [type] => milk [price] => 2.9 ) [pork] => Array ( [type] => pork [price] => 5.43 ) )
Output for 5.6.1
1.1205673217773E-5 1.2874603271484E-5Array ( [0] => Array ( [type] => pork [price] => 5.43 ) [1] => Array ( [type] => fruit [price] => 3.5 ) [2] => Array ( [type] => milk [price] => 2.9 ) ) Array ( [fruit] => Array ( [type] => fruit [price] => 3.5 ) [milk] => Array ( [type] => milk [price] => 2.9 ) [pork] => Array ( [type] => pork [price] => 5.43 ) )
Output for 5.6.0
1.215934753418E-5 1.3828277587891E-5Array ( [0] => Array ( [type] => pork [price] => 5.43 ) [1] => Array ( [type] => fruit [price] => 3.5 ) [2] => Array ( [type] => milk [price] => 2.9 ) ) Array ( [fruit] => Array ( [type] => fruit [price] => 3.5 ) [milk] => Array ( [type] => milk [price] => 2.9 ) [pork] => Array ( [type] => pork [price] => 5.43 ) )