3v4l.org

run code in 300+ PHP versions simultaneously
<?php /*function rev($str) { if ( ! $str ) { return; } return rev(substr($str,1)) . $str{0}; }*/ function sum($arr) { if ( empty($arr) ) { return $arr[0]; } return sum(array_shift($arr)); } $a = array(5,4,7,8,9,3); echo sum($a);
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught TypeError: array_shift(): Argument #1 ($array) must be of type array, int given in /in/T0u6T:13 Stack trace: #0 /in/T0u6T(13): array_shift(5) #1 /in/T0u6T(13): sum(5) #2 /in/T0u6T(17): sum(Array) #3 {main} thrown in /in/T0u6T on line 13
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:
51.85 ms | 401 KiB | 8 Q