3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $nums = [1,4,6]; function addNextNumber($current, array $nums) { $current += array_pop($nums); if (count($nums) === 0) { return $current; } return addNextNumber($current, $nums); } $result = addNextNumber(0, $nums); var_dump($result);
based on AQbbZ
Output for 5.4.1 - 7.2.0
int(11)
Output for 5.3.14 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/3PKWA on line 3
Process exited with code 255.