3v4l.org

run code in 300+ PHP versions simultaneously
<?php $date = new DateTime(); var_dump($date); $date2 = \DateTime::createFromFormat('U', $date->format('U'), 128); 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:02.003673" ["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/OF30C:7 Stack trace: #0 /in/OF30C(7): DateTime::createFromFormat('U', '1449593882', 128) #1 {main} thrown in /in/OF30C 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:02.004282" ["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/OF30C:7 Stack trace: #0 /in/OF30C(7): DateTime::createFromFormat('U', '1449593882', 128) #1 {main} thrown in /in/OF30C 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:02.003723" ["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/OF30C:7 Stack trace: #0 /in/OF30C(7): DateTime::createFromFormat('U', '1449593882', 128) #1 {main} thrown in /in/OF30C 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:
35.39 ms | 401 KiB | 8 Q