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')); var_dump($nowUtc->format('Y-m-d H:i:s')); var_dump($nowUtc->format('Y-m-d H:i:s'));
Output for git.master
$nowUtc object(DateTime)#1 (3) { ["date"]=> string(26) "2016-01-18 12:53:37.003991" ["timezone_type"]=> int(3) ["timezone"]=> string(3) "UTC" } $nowUtc->format('Y-m-d H:i:s') string(19) "2016-01-18 12:53:37" $nowUtc->setTimezone( new \DateTimeZone( 'Australia/Sydney' ) ) object(DateTime)#2 (3) { ["date"]=> string(26) "2016-01-18 23:53:37.004028" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Australia/Sydney" } $nowUtc->format('Y-m-d H:i:s') string(19) "2016-01-18 23:53:37" string(19) "2016-01-18 23:53:37" string(19) "2016-01-18 23:53:37"
Output for git.master_jit
$nowUtc object(DateTime)#1 (3) { ["date"]=> string(26) "2016-01-18 12:53:37.003661" ["timezone_type"]=> int(3) ["timezone"]=> string(3) "UTC" } $nowUtc->format('Y-m-d H:i:s') string(19) "2016-01-18 12:53:37" $nowUtc->setTimezone( new \DateTimeZone( 'Australia/Sydney' ) ) object(DateTime)#2 (3) { ["date"]=> string(26) "2016-01-18 23:53:37.003705" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Australia/Sydney" } $nowUtc->format('Y-m-d H:i:s') string(19) "2016-01-18 23:53:37" string(19) "2016-01-18 23:53:37" string(19) "2016-01-18 23:53:37"
Output for rfc.property-hooks
$nowUtc object(DateTime)#1 (3) { ["date"]=> string(26) "2016-01-18 12:53:37.003667" ["timezone_type"]=> int(3) ["timezone"]=> string(3) "UTC" } $nowUtc->format('Y-m-d H:i:s') string(19) "2016-01-18 12:53:37" $nowUtc->setTimezone( new \DateTimeZone( 'Australia/Sydney' ) ) object(DateTime)#2 (3) { ["date"]=> string(26) "2016-01-18 23:53:37.003705" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Australia/Sydney" } $nowUtc->format('Y-m-d H:i:s') string(19) "2016-01-18 23:53:37" string(19) "2016-01-18 23:53:37" string(19) "2016-01-18 23:53:37"

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