3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ [ 'name' => 'Foo', 'children' => [ 'B', 'A' ] ], [ 'name' => 'Bar', 'children' => [ 'Z', 'X', 'Y' ] ] ]; usort($array, function(&$x, &$y) { sort($x['children']); sort($y['children']); var_dump($x['children'], $y['children']); return strcasecmp($x['name'], $y['name']); }); var_dump($array);
Output for git.master, git.master_jit, rfc.property-hooks
Warning: {closure}(): Argument #1 ($x) must be passed by reference, value given in /in/R3KFA on line 21 Warning: {closure}(): Argument #2 ($y) must be passed by reference, value given in /in/R3KFA on line 21 array(2) { [0]=> string(1) "A" [1]=> string(1) "B" } array(3) { [0]=> string(1) "X" [1]=> string(1) "Y" [2]=> string(1) "Z" } array(2) { [0]=> array(2) { ["name"]=> string(3) "Bar" ["children"]=> array(3) { [0]=> string(1) "Z" [1]=> string(1) "X" [2]=> string(1) "Y" } } [1]=> array(2) { ["name"]=> string(3) "Foo" ["children"]=> array(2) { [0]=> string(1) "B" [1]=> string(1) "A" } } }

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:
58.22 ms | 402 KiB | 8 Q