3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { protected function order($a, $b) { if ($a == $b) { return 0; } return ($a < $b) ? -1 : 1; } public function sortStuff($arr) { usort($arr, [$this, 'order']); return $arr; } } $f = new Foo(); print_r($f->sortStuff([5, 6, 8, 3, 7, 9]));
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [0] => 3 [1] => 5 [2] => 6 [3] => 7 [4] => 8 [5] => 9 )

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