3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = [456, 8, 1, -9, 'string', true, 0, -65, -162]; usort($arr, function ($a, $b) { if (is_integer($a) && !is_integer($b)) return -1; elseif (!is_integer($a) && is_integer($b)) return 1; else return $b <=> $a; }); var_dump($arr);
Output for git.master, git.master_jit, rfc.property-hooks
array(9) { [0]=> int(456) [1]=> int(8) [2]=> int(1) [3]=> int(0) [4]=> int(-9) [5]=> int(-65) [6]=> int(-162) [7]=> string(6) "string" [8]=> 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:
176.55 ms | 405 KiB | 5 Q