3v4l.org

run code in 300+ PHP versions simultaneously
<?php function sum() { $list = array(); $prepare = function($value) use(&$prepare, &$list) { if (is_array($value)) { return array_walk($value, $prepare, $list); } else { $list[] = $value; } }; $args = func_get_args(); array_walk($args, $prepare, $list); return addition(0, $list); } function addition($sum, array &$list) { return empty($list) ? $sum : addition($sum + array_pop($list), $list); } $vars = range(1, 1000); echo sum($vars);
Output for git.master, git.master_jit, rfc.property-hooks
500500

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:
64.68 ms | 401 KiB | 8 Q