3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = [1,3,45,2,7,0,1,0]; echo removeZeroAndSumFirstThree(); function removeZeroAndSumFirstThree($arr) { asort($arr); //Remove 0 from array $a = array_diff($arr, [0]); $output = array_slice($a, 0, 3); return array_sum($output); }
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught ArgumentCountError: Too few arguments to function removeZeroAndSumFirstThree(), 0 passed in /in/AIU2F on line 4 and exactly 1 expected in /in/AIU2F:6 Stack trace: #0 /in/AIU2F(4): removeZeroAndSumFirstThree() #1 {main} thrown in /in/AIU2F on line 6
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:
90.27 ms | 1703 KiB | 4 Q