3v4l.org

run code in 300+ PHP versions simultaneously
<?php $as = [ [3, 4, 2, 5, 1], ['p', 'h', 'p'], [5, 2, 1, 4, 3], ]; $x = sort_foreach($as); $y = sort_array_map($as); $z = sort_array_walk($as); var_dump($x === $y && $x === $z && $y === $z); //var_dump($x, $y, $z); function sort_foreach(array $as) { foreach ($as as $k => $a) { sort($a); $as[$k] = $a; } return $as; } function sort_array_map(array $as) { return array_map(function ($a) { sort($a); return $a; }, $as); } function sort_array_walk(array $as) { array_walk($as, function (&$a) { sort($a); }); return $as; }
Output for git.master, git.master_jit, rfc.property-hooks
bool(true)

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:
35.6 ms | 401 KiB | 8 Q