3v4l.org

run code in 300+ PHP versions simultaneously
<?php $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'));exit; ?>
Output for git.master
$nowUtc object(DateTime)#1 (3) { ["date"]=> string(26) "2020-04-27 15:37:54.004066" ["timezone_type"]=> int(3) ["timezone"]=> string(3) "UTC" } $nowUtc->format('Y-m-d h:i:s') string(19) "2020-04-27 03:37:54" $nowUtc->setTimezone( new \DateTimeZone( 'Australia/Sydney' ) ) object(DateTime)#2 (3) { ["date"]=> string(26) "2020-04-28 01:37:54.004107" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Australia/Sydney" } $nowUtc->format('Y-m-d h:i:s') string(19) "2020-04-28 01:37:54"
Output for git.master_jit
$nowUtc object(DateTime)#1 (3) { ["date"]=> string(26) "2020-04-27 15:37:54.003786" ["timezone_type"]=> int(3) ["timezone"]=> string(3) "UTC" } $nowUtc->format('Y-m-d h:i:s') string(19) "2020-04-27 03:37:54" $nowUtc->setTimezone( new \DateTimeZone( 'Australia/Sydney' ) ) object(DateTime)#2 (3) { ["date"]=> string(26) "2020-04-28 01:37:54.003834" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Australia/Sydney" } $nowUtc->format('Y-m-d h:i:s') string(19) "2020-04-28 01:37:54"
Output for rfc.property-hooks
$nowUtc object(DateTime)#1 (3) { ["date"]=> string(26) "2020-04-27 15:37:54.003682" ["timezone_type"]=> int(3) ["timezone"]=> string(3) "UTC" } $nowUtc->format('Y-m-d h:i:s') string(19) "2020-04-27 03:37:54" $nowUtc->setTimezone( new \DateTimeZone( 'Australia/Sydney' ) ) object(DateTime)#2 (3) { ["date"]=> string(26) "2020-04-28 01:37:54.003726" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Australia/Sydney" } $nowUtc->format('Y-m-d h:i:s') string(19) "2020-04-28 01:37:54"

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