3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = []; array_push($array, 0); array_push($array, 0.64470922960398); array_push($array, 0.41076734188039); array_push($array, 0.20185418833199); array_push($array, 0.18053564755758); array_push($array, 0.42409442817103); array_push($array, 0.60058510748602); asort($array); print_r($array); asort($array, SORT_NUMERIC); print_r($array); $array = array_map(function ($num) { return (int)($num * 10); }, $array); asort($array); print_r($array);
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [0] => 0 [4] => 0.18053564755758 [3] => 0.20185418833199 [2] => 0.41076734188039 [5] => 0.42409442817103 [6] => 0.60058510748602 [1] => 0.64470922960398 ) Fatal error: Uncaught Error: Undefined constant " SORT_NUMERIC" in /in/aKZKu:15 Stack trace: #0 {main} thrown in /in/aKZKu on line 15
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:
35.37 ms | 401 KiB | 8 Q