3v4l.org

run code in 300+ PHP versions simultaneously
<?php date_default_timezone_set('America/New_York'); $InitialDateTime = DateTime::createFromFormat('U', '1409611999'); $firstDayofWeek = clone $InitialDateTime; $firstDayofWeek->modify('Monday This Week'); $lastDayofWeek = clone $InitialDateTime; $lastDayofWeek->modify('Sunday Next'); var_dump($InitialDateTime, $firstDayofWeek, $lastDayofWeek);
Output for git.master, git.master_jit
Warning: DateTime::modify(): Failed to parse time string (Sunday Next) at position 7 (N): The timezone could not be found in the database in /in/ZqkHR on line 10 object(DateTime)#1 (3) { ["date"]=> string(26) "2014-09-01 22:53:19.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" } object(DateTime)#2 (3) { ["date"]=> string(26) "2014-09-01 00:00:00.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" } object(DateTime)#3 (3) { ["date"]=> string(26) "2014-09-01 22:53:19.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" }
Output for rfc.property-hooks
Fatal error: Uncaught DateMalformedStringException: DateTime::modify(): Failed to parse time string (Sunday Next) at position 7 (N): The timezone could not be found in the database in /in/ZqkHR:10 Stack trace: #0 /in/ZqkHR(10): DateTime->modify('Sunday Next') #1 {main} thrown in /in/ZqkHR 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:
35.29 ms | 401 KiB | 8 Q