3v4l.org

run code in 300+ PHP versions simultaneously
<?php function getyearly($monthly, $yearly) { if(!empty($monthly) && !empty($yearly)) { $permonth=intdiv((int)$yearly, 12); echo "Single payment will feel like 12-monthly payments of: $permonth (" , $permonth *12 . ")\n"; $monthlytoyear=(int)$monthly*12; echo "Making monthly payments will actually come to: $monthlytoyear\n"; $aftersub = $monthlytoyear-$yearly; echo "That is a difference of: $aftersub\n"; $afterdiv = $aftersub / $yearly; echo "In other words, a savings of: " , $afterdiv , "\n"; $finaly=(int)($afterdiv*100); return "$ ".$yearly."/year ($".round($permonth)."/month; save ~{$finaly}%)"; } else { return '$ '.$yearly.'/yearly'; } } $monthly='60'; $yearly= '480'; echo getyearly($monthly,$yearly);
Output for git.master, git.master_jit, rfc.property-hooks
Single payment will feel like 12-monthly payments of: 40 (480) Making monthly payments will actually come to: 720 That is a difference of: 240 In other words, a savings of: 0.5 $ 480/year ($40/month; save ~50%)

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:
169.13 ms | 406 KiB | 5 Q