3v4l.org

run code in 300+ PHP versions simultaneously
<?php $sunday = 0; $monday = 1; $saturday =6; $date = new \DateTime(/* any point in time and space */); $weekStart = (new \DateTime())->setISODate((int)$date->format('o'), (int)$date->format('W'), $monday)->setTime(0, 0, 0); $weekEnd = (new \DateTime())->setISODate((int)$date->format('o'), (int)$date->format('W') + 1, $sunday)->setTime(23, 59, 59); echo $weekStart->format('Y m d H:i:s') . '->' . $weekEnd('Y m d H:i:s');
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught Error: Object of type DateTime is not callable in /in/uUATV:10 Stack trace: #0 {main} thrown in /in/uUATV on line 10
Process exited with code 255.

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