3v4l.org

run code in 300+ PHP versions simultaneously
<?php $date = new DateTime(); var_dump($date); $date2 = \DateTime::createFromFormat('U', $date->format('U'), $date->getTimezone()); var_dump($date2); $date3 = clone $date; $date3->sub(new DateInterval("P1S")); var_dump($date3);
Output for git.master
object(DateTime)#1 (3) { ["date"]=> string(26) "2015-12-08 17:55:01.004015" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#3 (3) { ["date"]=> string(26) "2015-12-08 16:55:01.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" } Fatal error: Uncaught Exception: Unknown or bad format (P1S) in /in/IfQKF:12 Stack trace: #0 /in/IfQKF(12): DateInterval->__construct('P1S') #1 {main} thrown in /in/IfQKF on line 12
Process exited with code 255.
Output for git.master_jit
object(DateTime)#1 (3) { ["date"]=> string(26) "2015-12-08 17:55:01.003806" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#3 (3) { ["date"]=> string(26) "2015-12-08 16:55:01.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" } Fatal error: Uncaught Exception: Unknown or bad format (P1S) in /in/IfQKF:12 Stack trace: #0 /in/IfQKF(12): DateInterval->__construct('P1S') #1 {main} thrown in /in/IfQKF on line 12
Process exited with code 255.
Output for rfc.property-hooks
object(DateTime)#1 (3) { ["date"]=> string(26) "2015-12-08 17:55:01.003546" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#3 (3) { ["date"]=> string(26) "2015-12-08 16:55:01.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" } Fatal error: Uncaught DateMalformedIntervalStringException: Unknown or bad format (P1S) in /in/IfQKF:12 Stack trace: #0 /in/IfQKF(12): DateInterval->__construct('P1S') #1 {main} thrown in /in/IfQKF on line 12
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:
51.06 ms | 401 KiB | 8 Q