3v4l.org

run code in 300+ PHP versions simultaneously
<?php //Prior 8.1 for php +1 month https://www.php.net/manual/en/datetime.examples-arithmetic.php function printDiff($tz) { $d1 = new \DateTime("2015-06-01", new \DateTimeZone($tz)); $d2 = new \DateTime("2015-07-01", new \DateTimeZone($tz)); $diff = $d1->diff($d2); print($diff->format("Start: " . ((new \DateTime('@'.($d1->format("U"))))->format("Y-m-d H:i:s")) . " End: " . ((new \DateTime('@'.($d2->format("U"))))->format("Y-m-d H:i:s")) . " Year: %Y Month: %M Day: %D") .PHP_EOL); } \printDiff("UTC"); \printDiff("Australia/Melbourne");
Output for git.master, git.master_jit, rfc.property-hooks
Start: 2015-06-01 00:00:00 End: 2015-07-01 00:00:00 Year: 00 Month: 01 Day: 00 Start: 2015-05-31 14:00:00 End: 2015-06-30 14:00:00 Year: 00 Month: 01 Day: 00

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