3v4l.org

run code in 300+ PHP versions simultaneously
<?php echo ini_get('date.timezone').PHP_EOL; $nowUtc = new \DateTime( 'now', new \DateTimeZone( 'UTC' ) ); echo '$nowUtc'.PHP_EOL; var_dump($nowUtc); $nowUtc = new \DateTime( 'now', new \DateTimeZone( 'UTC' ) ); echo '$nowUtc->format(\'Y-m-d H:i:s\')'.PHP_EOL; var_dump($nowUtc->format('Y-m-d H:i:s')); $nowUtc->setTimezone( new \DateTimeZone( 'Australia/Sydney' ) ); echo '$nowUtc->setTimezone( new \DateTimeZone( \'Australia/Sydney\' ) )'.PHP_EOL; var_dump($nowUtc); echo '$nowUtc->format(\'Y-m-d H:i:s\')'.PHP_EOL; var_dump($nowUtc->format('Y-m-d H:i:s')); var_dump($nowUtc->format('Y-m-d H:i:s')); var_dump($nowUtc->format('Y-m-d H:i:s'));
Output for git.master
Europe/Amsterdam $nowUtc object(DateTime)#1 (3) { ["date"]=> string(26) "2016-01-18 12:54:24.003501" ["timezone_type"]=> int(3) ["timezone"]=> string(3) "UTC" } $nowUtc->format('Y-m-d H:i:s') string(19) "2016-01-18 12:54:24" $nowUtc->setTimezone( new \DateTimeZone( 'Australia/Sydney' ) ) object(DateTime)#2 (3) { ["date"]=> string(26) "2016-01-18 23:54:24.003532" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Australia/Sydney" } $nowUtc->format('Y-m-d H:i:s') string(19) "2016-01-18 23:54:24" string(19) "2016-01-18 23:54:24" string(19) "2016-01-18 23:54:24"
Output for git.master_jit
Europe/Amsterdam $nowUtc object(DateTime)#1 (3) { ["date"]=> string(26) "2016-01-18 12:54:24.004102" ["timezone_type"]=> int(3) ["timezone"]=> string(3) "UTC" } $nowUtc->format('Y-m-d H:i:s') string(19) "2016-01-18 12:54:24" $nowUtc->setTimezone( new \DateTimeZone( 'Australia/Sydney' ) ) object(DateTime)#2 (3) { ["date"]=> string(26) "2016-01-18 23:54:24.004126" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Australia/Sydney" } $nowUtc->format('Y-m-d H:i:s') string(19) "2016-01-18 23:54:24" string(19) "2016-01-18 23:54:24" string(19) "2016-01-18 23:54:24"
Output for rfc.property-hooks
Europe/Amsterdam $nowUtc object(DateTime)#1 (3) { ["date"]=> string(26) "2016-01-18 12:54:24.006872" ["timezone_type"]=> int(3) ["timezone"]=> string(3) "UTC" } $nowUtc->format('Y-m-d H:i:s') string(19) "2016-01-18 12:54:24" $nowUtc->setTimezone( new \DateTimeZone( 'Australia/Sydney' ) ) object(DateTime)#2 (3) { ["date"]=> string(26) "2016-01-18 23:54:24.006925" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Australia/Sydney" } $nowUtc->format('Y-m-d H:i:s') string(19) "2016-01-18 23:54:24" string(19) "2016-01-18 23:54:24" string(19) "2016-01-18 23:54:24"

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