3v4l.org

run code in 300+ PHP versions simultaneously
<?php //$values = [ 16, 32, 48]; $values = range(16, 1000000, 2); function getCmmdc($values) { $num_values = count($values); $x = current($values); $y = next($values); for ($i = 1; $i < $num_values; $i ++) { $a = max($x, $y); $b = min($x, $y); $c= 1; do { $c = $a % $b; $gcf = $b; $a = $b; $b = $c; } while ($c != 0); $x = $gcf; $y = next($values); } //suma tuturor divizilorilor $sum = 0; for($i = 1; $i <= $gcf; $i ++){ $temp = $gcf % $i; if($temp == 0){ $sum += $i; } } return array($gcf, $sum); } getCmmdc($values);
Output for git.master, git.master_jit, rfc.property-hooks

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