3v4l.org

run code in 300+ PHP versions simultaneously
<?php function parseDate($dateValue) { $dateFormats = array( 'D, d M y H:i:s T', 'D, d M Y H:i:s T', 'D, d-M-y H:i:s T', 'D, d-M-Y H:i:s T', 'D, d-m-y H:i:s T', 'D, d-m-Y H:i:s T', 'D M j G:i:s Y', 'D M d H:i:s Y T', ); foreach ($dateFormats as $dateFormat) { if (false !== $date = \DateTime::createFromFormat($dateFormat, $dateValue, new \DateTimeZone('GMT'))) { return $date; } } return date_create($dateValue, new \DateTimeZone('GMT')); } $dates = array( array('Friday, 31-Jul-20 08:49:37 GMT', 'Friday, 31-Jul-2020 08:49:37 GMT'), array('Fri Jul 31 08:49:37 2020', 'Friday, 31-Jul-2020 08:49:37 GMT'), ); foreach ($dates as $date) { echo parseDate($date[0])->format(\DateTime::COOKIE) . "\n"; }
Output for git.master, git.master_jit, rfc.property-hooks
Friday, 31-Jul-2020 08:49:37 GMT Friday, 31-Jul-2020 08:49:37 GMT

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:
27.52 ms | 405 KiB | 5 Q