3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array1 = [ "3" => "aBc", "ab" => "abc12", "lkT" => 2, "65" => "Abc", 45 => "test", "This" => "is this", "2" => "abc", false => "abc012", " " => 22.22, ]; $array2 = [ "5" => "abc", "2" => "bca", "1" => "?", "33" => "he11o", ]; print_r($array1); print_r($array2); array_multisort($array1, SORT_ASC, SORT_NUMERIC, $array2, SORT_DESC, SORT_NATURAL ); print_r($array1); print_r($array2);
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [3] => aBc [ab] => abc12 [lkT] => 2 [65] => Abc [45] => test [This] => is this [2] => abc [0] => abc012 [ ] => 22.22 ) Array ( [5] => abc [2] => bca [1] => ? [33] => he11o ) Fatal error: Uncaught ValueError: Array sizes are inconsistent in /in/u0Ft0:24 Stack trace: #0 /in/u0Ft0(24): array_multisort(Array, 4, 1, Array, 3, 6) #1 {main} thrown in /in/u0Ft0 on line 24
Process exited with code 255.

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
44.58 ms | 406 KiB | 5 Q