3v4l.org

run code in 300+ PHP versions simultaneously
<?php $tz = new \DateTimeZone('Europe/Berlin'); $d1 = new \DateTime(); $d2 = new \DateTime($d1->format(\DateTime::ATOM), $tz); $d3 = new \DateTime($d1->format('Y-m-d H:i'), $tz); var_dump($d1); var_dump($d2); var_dump($d3);
Output for git.master
object(DateTime)#2 (3) { ["date"]=> string(26) "2018-04-03 13:22:41.003688" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#3 (3) { ["date"]=> string(26) "2018-04-03 13:22:41.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+02:00" } object(DateTime)#4 (3) { ["date"]=> string(26) "2018-04-03 13:22:00.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/Berlin" }
Output for git.master_jit
object(DateTime)#2 (3) { ["date"]=> string(26) "2018-04-03 13:22:41.003857" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#3 (3) { ["date"]=> string(26) "2018-04-03 13:22:41.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+02:00" } object(DateTime)#4 (3) { ["date"]=> string(26) "2018-04-03 13:22:00.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/Berlin" }
Output for rfc.property-hooks
object(DateTime)#2 (3) { ["date"]=> string(26) "2018-04-03 13:22:41.003525" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#3 (3) { ["date"]=> string(26) "2018-04-03 13:22:41.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+02:00" } object(DateTime)#4 (3) { ["date"]=> string(26) "2018-04-03 13:22:00.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/Berlin" }

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:
70.51 ms | 402 KiB | 8 Q