3v4l.org

run code in 300+ PHP versions simultaneously
<?php $date = new DateTime(); var_dump($date); $date2 = \DateTime::createFromFormat('U', $date->format('U'), DateTimeZone::EUROPE); var_dump($date2); $date3 = clone $date; $date3->sub(new DateInterval("P1M")); var_dump($date3);
Output for git.master
object(DateTime)#1 (3) { ["date"]=> string(26) "2015-12-08 17:58:37.004044" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } Fatal error: Uncaught TypeError: DateTime::createFromFormat(): Argument #3 ($timezone) must be of type ?DateTimeZone, int given in /in/K9HGr:7 Stack trace: #0 /in/K9HGr(7): DateTime::createFromFormat('U', '1449593917', 128) #1 {main} thrown in /in/K9HGr on line 7
Process exited with code 255.
Output for git.master_jit
object(DateTime)#1 (3) { ["date"]=> string(26) "2015-12-08 17:58:37.003827" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } Fatal error: Uncaught TypeError: DateTime::createFromFormat(): Argument #3 ($timezone) must be of type ?DateTimeZone, int given in /in/K9HGr:7 Stack trace: #0 /in/K9HGr(7): DateTime::createFromFormat('U', '1449593917', 128) #1 {main} thrown in /in/K9HGr on line 7
Process exited with code 255.
Output for rfc.property-hooks
object(DateTime)#1 (3) { ["date"]=> string(26) "2015-12-08 17:58:37.003641" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } Fatal error: Uncaught TypeError: DateTime::createFromFormat(): Argument #3 ($timezone) must be of type ?DateTimeZone, int given in /in/K9HGr:7 Stack trace: #0 /in/K9HGr(7): DateTime::createFromFormat('U', '1449593917', 128) #1 {main} thrown in /in/K9HGr on line 7
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:
44.7 ms | 401 KiB | 8 Q