3v4l.org

run code in 300+ PHP versions simultaneously
<?php date_default_timezone_set('Europe/London'); $format = 'Y-m-d H:i e'; $times = array( '2015-10-24 15:00:00 01:00:00 BST', '2015-10-25 15:00:00 01:00:00 BST', '2015-10-26 15:00:00 01:00:00 BST' ); foreach ($times as $time) { $dt = DateTime::createFromFormat('Y-m-d H:i:s T', $time, new DateTimeZone('Europe/London')); echo "Localised:\n"; echo $dt->format($format) . "\n\n"; echo "Putting into UTC:\n"; $dt->setTimezone(new DateTimeZone('UTC')); echo $dt->format($format) . "\n\n"; }
Output for git.master, git.master_jit
Localised: Fatal error: Uncaught Error: Call to a member function format() on bool in /in/j8F9R:16 Stack trace: #0 {main} thrown in /in/j8F9R on line 16
Process exited with code 255.
Output for rfc.property-hooks
Localised: Fatal error: Uncaught Error: Call to a member function format() on false in /in/j8F9R:16 Stack trace: #0 {main} thrown in /in/j8F9R on line 16
Process exited with code 255.

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:
59.22 ms | 401 KiB | 8 Q