3v4l.org

run code in 300+ PHP versions simultaneously
<?php function add ($v1,$v2) { $v[] = (string) $v1; $v[] = (string) $v2; foreach ($v as $val) { $match = array(); preg_match('/\.(\d*)/',$val,$match); if (isset($match[1])) { $dec[] = strlen($match[1]); } else { $dec[] = 0; } } var_dump(bcadd($v[0],$v[1],max($dec))); } add(10.756,10.98324534); add(10,10); add(10.756,10.9); add(10.756,10.); add(10.756,10);
Output for git.master, git.master_jit, rfc.property-hooks
string(11) "21.73924534" string(2) "20" string(6) "21.656" string(6) "20.756" string(6) "20.756"

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