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) "2016-01-18 12:52:03.003434" ["timezone_type"]=> int(3) ["timezone"]=> string(3) "UTC" } $nowUtc->format('Y-m-d h:i:s') string(19) "2016-01-18 12:52:03" $nowUtc->setTimezone( new \DateTimeZone( 'Australia/Sydney' ) ) object(DateTime)#2 (3) { ["date"]=> string(26) "2016-01-18 23:52:03.003479" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Australia/Sydney" } $nowUtc->format('Y-m-d h:i:s') string(19) "2016-01-18 11:52:03"
Output for git.master_jit
$nowUtc object(DateTime)#1 (3) { ["date"]=> string(26) "2016-01-18 12:52:03.003812" ["timezone_type"]=> int(3) ["timezone"]=> string(3) "UTC" } $nowUtc->format('Y-m-d h:i:s') string(19) "2016-01-18 12:52:03" $nowUtc->setTimezone( new \DateTimeZone( 'Australia/Sydney' ) ) object(DateTime)#2 (3) { ["date"]=> string(26) "2016-01-18 23:52:03.003857" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Australia/Sydney" } $nowUtc->format('Y-m-d h:i:s') string(19) "2016-01-18 11:52:03"
Output for rfc.property-hooks
$nowUtc object(DateTime)#1 (3) { ["date"]=> string(26) "2016-01-18 12:52:03.003585" ["timezone_type"]=> int(3) ["timezone"]=> string(3) "UTC" } $nowUtc->format('Y-m-d h:i:s') string(19) "2016-01-18 12:52:03" $nowUtc->setTimezone( new \DateTimeZone( 'Australia/Sydney' ) ) object(DateTime)#2 (3) { ["date"]=> string(26) "2016-01-18 23:52:03.003621" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Australia/Sydney" } $nowUtc->format('Y-m-d h:i:s') string(19) "2016-01-18 11:52:03"

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