3v4l.org

run code in 300+ PHP versions simultaneously
<?php function coins_value($input1) { $p = 1; $q = 0; $m = 0; $n = 1; $res=array(0,0); if (($input1[0] < 0) || ($input1[1] < 0)) { return $res; } while ($input1[1] != 0) { $quot = ($input1[0])/($input1[1]); $rem = ($input1[0])% ($input1[1]); $input1[0] = $input1[1]; $input1[1] = $rem; $tmp = $m; $m = $p - ($quot * $m); $p = $tmp; $tmp = $n; $n = $q - ($quot * $n); $q = $tmp; } if ($input1[0] >= 0) { $res[0] = $p; $res[1] = $q; return $res; } $res[0] = -$p; $res[1] = -$q; return $res; } var_dump(coins_value([12, 25]));
Output for git.master, git.master_jit, rfc.property-hooks
array(2) { [0]=> float(-2.0833333333333335) [1]=> float(2) }

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