3v4l.org

run code in 300+ PHP versions simultaneously
<?php // 数字の文字列に対する総和を計算する function calculateSum(string $param) : string { $su = (int)$param; $res = 0; for ($i = 1; $i <= $su; $i++) { $res += $i; } if ($su <= 0) { return "ERROR"; } return (string)$res; } var_dump(calculateSum('10'));
Output for git.master, git.master_jit, rfc.property-hooks
string(2) "55"

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.5 ms | 401 KiB | 8 Q