3v4l.org

run code in 300+ PHP versions simultaneously
<?php $tz = new \DateTimeZone('Europe/Moscow'); $dt = new DateTimeImmutable('now'); $dt->setTimezone($tz); $timestamp = (int) $dt->format('U'); $timestamp += 1000; $dt2 = \DateTimeImmutable::createFromFormat('U', $timestamp, $tz); var_dump($dt, $dt2);
Output for git.master
object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "2015-10-28 15:55:06.003597" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#3 (3) { ["date"]=> string(26) "2015-10-28 15:11:46.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" }
Output for git.master_jit
object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "2015-10-28 15:55:06.003716" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#3 (3) { ["date"]=> string(26) "2015-10-28 15:11:46.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" }
Output for rfc.property-hooks
object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "2015-10-28 15:55:06.003555" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#3 (3) { ["date"]=> string(26) "2015-10-28 15:11:46.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+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:
47.96 ms | 401 KiB | 8 Q