3v4l.org

run code in 300+ PHP versions simultaneously
<?php var_dump(date_default_timezone_get()); // Note: The unix timestamp used is the time this entry was created, not 2016-12-18 var_dump((new \DateTime("2016-12-18"))->format('c')); var_dump((new \DateTime("12/18/2016"))->format('c')); var_dump((new \DateTime("@1479664889"))->format('c')); var_dump((DateTime::createFromFormat("Y-m-d", "2016-12-18"))->format('c')); var_dump((DateTime::createFromFormat("m/d/Y", "12/18/2016"))->format('c')); var_dump((DateTime::createFromFormat("U", "1479664889"))->format('c')); print "---\n"; $lastExample = DateTime::createFromFormat("d/m/Y", "12/18/2016"); var_dump($lastExample->format('c')); var_dump(DateTime::getLastErrors()); $lastExample->setTimeZone(new \DateTimeZone("America/New_York")); var_dump($lastExample->format('c'));
Output for git.master, git.master_jit, rfc.property-hooks
string(16) "Europe/Amsterdam" string(25) "2016-12-18T00:00:00+01:00" string(25) "2016-12-18T00:00:00+01:00" string(25) "2016-11-20T18:01:29+00:00" string(25) "2016-12-18T19:12:50+01:00" string(25) "2016-12-18T19:12:50+01:00" string(25) "2016-11-20T18:01:29+00:00" --- string(25) "2017-06-12T19:12:50+02:00" array(4) { ["warning_count"]=> int(1) ["warnings"]=> array(1) { [10]=> string(27) "The parsed date was invalid" } ["error_count"]=> int(0) ["errors"]=> array(0) { } } string(25) "2017-06-12T13:12:50-04:00"

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:
159.96 ms | 407 KiB | 5 Q