3v4l.org

run code in 300+ PHP versions simultaneously
<?php class FooBar extends DateTime { public function foo($timezone) { return $this->setTimezone(new DateTimeZone($timezone)); } } $f = new FooBar(); var_Dump($f); $f->foo('UTC'); var_Dump($f); $f->foo('+00:00'); var_Dump($f); $f->foo('GMT'); var_Dump($f);
Output for git.master
object(FooBar)#1 (3) { ["date"]=> string(26) "2019-06-19 17:27:06.004014" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(FooBar)#1 (3) { ["date"]=> string(26) "2019-06-19 15:27:06.004014" ["timezone_type"]=> int(3) ["timezone"]=> string(3) "UTC" } object(FooBar)#1 (3) { ["date"]=> string(26) "2019-06-19 15:27:06.004014" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" } object(FooBar)#1 (3) { ["date"]=> string(26) "2019-06-19 15:27:06.004014" ["timezone_type"]=> int(2) ["timezone"]=> string(3) "GMT" }
Output for git.master_jit
object(FooBar)#1 (3) { ["date"]=> string(26) "2019-06-19 17:27:06.003715" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(FooBar)#1 (3) { ["date"]=> string(26) "2019-06-19 15:27:06.003715" ["timezone_type"]=> int(3) ["timezone"]=> string(3) "UTC" } object(FooBar)#1 (3) { ["date"]=> string(26) "2019-06-19 15:27:06.003715" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" } object(FooBar)#1 (3) { ["date"]=> string(26) "2019-06-19 15:27:06.003715" ["timezone_type"]=> int(2) ["timezone"]=> string(3) "GMT" }
Output for rfc.property-hooks
object(FooBar)#1 (3) { ["date"]=> string(26) "2019-06-19 17:27:06.003537" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(FooBar)#1 (3) { ["date"]=> string(26) "2019-06-19 15:27:06.003537" ["timezone_type"]=> int(3) ["timezone"]=> string(3) "UTC" } object(FooBar)#1 (3) { ["date"]=> string(26) "2019-06-19 15:27:06.003537" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" } object(FooBar)#1 (3) { ["date"]=> string(26) "2019-06-19 15:27:06.003537" ["timezone_type"]=> int(2) ["timezone"]=> string(3) "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:
56.47 ms | 402 KiB | 8 Q