3v4l.org

run code in 300+ PHP versions simultaneously
<?php $date = new DateTime('2017-08-23 23:59:59'); function nextPayday($date) { $date->add(new DateInterval('P3D')); echo "Date + 3 days: ".$date->format('D Y-m-d') . "<br>"; $payDate = $date->add(new DateInterval('P1D')); $days = ["1", "2", "3", "4", "5"]; while (!in_array($payDate->format("N"), $days)) { $payDate->add(new DateInterval('P1D')); } return $payDate->format("D Y-m-d"); } echo "Next payday: ".nextPayday($date);
Output for git.master, git.master_jit, rfc.property-hooks
Date + 3 days: Sat 2017-08-26<br>Next payday: Mon 2017-08-28

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:
133.31 ms | 405 KiB | 5 Q