3v4l.org

run code in 300+ PHP versions simultaneously
<?php date_default_timezone_set('Australia/Sydney'); $value = '2010-09-08T07:05:04+0300'; $date = \DateTime::createFromFormat('Y-m-d\TH:i:sO', $value); echo $date->getTimezone() . PHP_EOL; print $date->format('c e') . PHP_EOL; $date->setTimezone(new \DateTimeZone('America/Managua')); echo $date->getTimezone() . PHP_EOL; print $date->format('c e') . PHP_EOL; $date->setTimezone(new \DateTimeZone('Australia/Sydney')); echo $date->getTimezone() . PHP_EOL; print $date->format('c e') . PHP_EOL;
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught Error: Object of class DateTimeZone could not be converted to string in /in/mUf36:7 Stack trace: #0 {main} thrown in /in/mUf36 on line 7
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:
18.18 ms | 401 KiB | 8 Q