3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = new \DateTimeImmutable('2021-01-01', new \DateTimeZone('Europe/Berlin')); $b = (clone $a); // $c = (clone $a)->setTimeZone(new \DateTimeZone('Europe/Paris')); // Same GMT offset but different timezone $d = (clone $a)->setTimeZone(new \DateTimeZone('Australia/Sydney')); // Different timezone $e = (clone $a)->modify('+1 second'); // Insufficient check assert($a == $b); assert($a == $c); assert($a == $d); assert($a != $e); // Check that accounts for timezone name (not just offset) assert($a->format('ce') === $b->format('ce')); assert($a->format('ce') !== $c->format('ce')); assert($a->format('ce') !== $d->format('ce')); assert($a->format('ce') !== $e->format('ce')); echo 'Done.';
Output for git.master, git.master_jit, rfc.property-hooks
Done.

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