3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = array( array( 'name' => 'Foo', 'children' => array( 'B', 'A', ), ), array( 'name' => 'Bar', 'children' => array( 'Z', 'X', 'Y', ), ), ); usort($array, function (&$x, &$y) { sort($x['children']); sort($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/LAHvs on line 21 Warning: {closure}(): Argument #2 ($y) must be passed by reference, value given in /in/LAHvs on line 21 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:
52.79 ms | 402 KiB | 8 Q