3v4l.org

run code in 300+ PHP versions simultaneously
<?php $datetime = new DateTime(null, new DateTimeZone('UTC')); $datetime_2 = clone $datetime; $datetime_2->add(new DateInterval('PT2S')); var_dump($datetime < $datetime_2); var_dump($datetime->getTimestamp() < $datetime_2->getTimestamp()); $datetime_2->setTimezone(new DateTimeZone('EST')); var_dump($datetime < $datetime_2); var_dump($datetime->getTimestamp() < $datetime_2->getTimestamp()); // Now that `getTimestamp()` has been called, it'll "magically" work... var_dump($datetime < $datetime_2);
Output for git.master, git.master_jit, rfc.property-hooks
Deprecated: DateTime::__construct(): Passing null to parameter #1 ($datetime) of type string is deprecated in /in/WkjAA on line 3 bool(true) bool(true) bool(true) bool(true) bool(true)

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:
81.55 ms | 406 KiB | 5 Q