3v4l.org

run code in 300+ PHP versions simultaneously
<?php $date = new DateTime(null); echo 'Default timezone: '.$date->getTimestamp().'<br />'."\r\n"; //America/New_York $date = new DateTime(null, new DateTimeZone('America/New_York')); echo 'America/New_York: '.$date->getTimestamp().'<br />'."\r\n"; //Europe/Amsterdam $date = new DateTime(null, new DateTimeZone('Europe/Amsterdam')); echo 'Europe/Amsterdam: '.$date->getTimestamp().'<br />'."\r\n"; echo 'WORK AROUND<br />'."\r\n"; // WORK AROUND //default timezone $date = new DateTime(null); echo 'Default timezone: '.($date->getTimestamp() + $date->getOffset()).'<br />'."\r\n"; //America/New_York $date = new DateTime(null, new DateTimeZone('America/New_York')); echo 'America/New_York: '.($date->getTimestamp() + $date->getOffset()).'<br />'."\r\n"; //Europe/Amsterdam $date = new DateTime(null, new DateTimeZone('Europe/Amsterdam')); echo 'Europe/Amsterdam: '.($date->getTimestamp() + $date->getOffset()).'<br />'."\r\n"; ?>
Output for git.master, git.master_jit, rfc.property-hooks
Deprecated: DateTime::__construct(): Passing null to parameter #1 ($datetime) of type string is deprecated in /in/I1hiH on line 2 Default timezone: 1394711461<br /> Deprecated: DateTime::__construct(): Passing null to parameter #1 ($datetime) of type string is deprecated in /in/I1hiH on line 6 America/New_York: 1394711461<br /> Deprecated: DateTime::__construct(): Passing null to parameter #1 ($datetime) of type string is deprecated in /in/I1hiH on line 10 Europe/Amsterdam: 1394711461<br /> WORK AROUND<br /> Deprecated: DateTime::__construct(): Passing null to parameter #1 ($datetime) of type string is deprecated in /in/I1hiH on line 16 Default timezone: 1394715061<br /> Deprecated: DateTime::__construct(): Passing null to parameter #1 ($datetime) of type string is deprecated in /in/I1hiH on line 20 America/New_York: 1394697061<br /> Deprecated: DateTime::__construct(): Passing null to parameter #1 ($datetime) of type string is deprecated in /in/I1hiH on line 24 Europe/Amsterdam: 1394715061<br />

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:
57.8 ms | 403 KiB | 8 Q