3v4l.org

run code in 300+ PHP versions simultaneously
<?php print "System Timezone: ". date_default_timezone_get() ."\n\n"; $inputDate = "5/30/18"; $formatter = new IntlDateFormatter('en-US', IntlDateFormatter::SHORT, IntlDateFormatter::NONE, 'Europe/Berlin'); $timestamp = $formatter->parse($inputDate); print "Using date:\n"; print "Timestamp: {$timestamp}\n"; print "Formatted: ". date(\DateTime::ATOM ." e", $timestamp) ."\n"; print "MySQL: ". date("Y-m-d H:i:s", $timestamp) ."\n"; print "\n\nUsing DateTime(Immutable):\n"; $dt = \DateTimeImmutable::createFromFormat("!U", $timestamp); print "Formatted: ". $dt->format(\DateTime::ATOM ." e") ."\n"; print "MySQL: ". $dt->format("Y-m-d H:i:s") ."\n";
Output for git.master, git.master_jit, rfc.property-hooks
System Timezone: Europe/Amsterdam Using date: Timestamp: 1527631200 Formatted: 2018-05-30T00:00:00+02:00 Europe/Amsterdam MySQL: 2018-05-30 00:00:00 Using DateTime(Immutable): Formatted: 2018-05-29T22:00:00+00:00 +00:00 MySQL: 2018-05-29 22:00: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:
57.79 ms | 401 KiB | 8 Q