3v4l.org

run code in 500+ PHP versions simultaneously
<?php $array = range(0, 10); usort($array, withBool(...)); print(implode(', ', $array)).PHP_EOL; // 9, 10, 7, 8, 5, 6, 4, 3, 2, 1, 0 usort($array, withInt(...)); print(implode(', ', $array)).PHP_EOL; // 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 function withBool($a, $b) : bool { return $a <=> $b; } function withInt($a, $b) : int { return $a <=> $b; } ?>
Output for git.master, git.master_jit
Deprecated: usort(): Returning bool from comparison function is deprecated, return an integer less than, equal to, or greater than zero in /in/BATHJ on line 5 9, 10, 7, 8, 5, 6, 4, 3, 2, 1, 0 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10

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:
55.7 ms | 865 KiB | 4 Q