3v4l.org

run code in 300+ PHP versions simultaneously
<?php foreach (['Etc/GMT+12', 'Etc/GMT-10'] as $timezone) { $dTZ = new DateTimeZone($timezone); // Create a DateTime using the DateTimeZone object // This will display both formatted and unix timestamp as expected $dT = new DateTime('2013-12-13 18:49:00', $dTZ); echo $dT->format('Y-m-d H:i:s T'), PHP_EOL; echo $dT->getTimestamp(), PHP_EOL; // Create a DateTime using only a string representation // This will display the formatted date/time as expected, // but with the incorrect timezone // The value returned by getTimestamp() for format('U') will // be off by 2*offset $dT2 = new DateTime($dT->format('Y-m-d H:i:s T')); echo $dT2->format('Y-m-d H:i:s T'), PHP_EOL; echo $dT2->getTimestamp(), PHP_EOL, PHP_EOL; }
Output for git.master, git.master_jit, rfc.property-hooks
2013-12-13 18:49:00 -12 1387003740 2013-12-13 18:49:00 GMT-1200 1387003740 2013-12-13 18:49:00 +10 1386924540 2013-12-13 18:49:00 GMT+1000 1386924540

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.07 ms | 401 KiB | 8 Q