3v4l.org

run code in 300+ PHP versions simultaneously
<?php $order = array('ACO', 'ZCO', 'Other'); function compare($a, $b) { $ai = array_search($a, $order); $bi = array_search($b, $order); return $a<$b ? -1 : $a>$b; } $a = array('ZCO'=>1, 'Other'=>1, 'ACO'=>1); uksort($a, "compare"); print_r($a);
Output for git.master, git.master_jit, rfc.property-hooks
Warning: Undefined variable $order in /in/6Y93q on line 7 Fatal error: Uncaught TypeError: array_search(): Argument #2 ($haystack) must be of type array, null given in /in/6Y93q:7 Stack trace: #0 /in/6Y93q(7): array_search('ZCO', NULL) #1 [internal function]: compare('ZCO', 'Other') #2 /in/6Y93q(12): uksort(Array, 'compare') #3 {main} thrown in /in/6Y93q on line 7
Process exited with code 255.

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