3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Get an interval between 1st January and 14th January $diff1 = (new DateTimeImmutable('2019-01-01'))->diff(new DateTimeImmutable('2019-01-14')); // Get another interval, but this time an extra day on the end $diff2 = (new DateTimeImmutable('2019-01-01'))->diff(new DateTimeImmutable('2019-01-15')); // Check if the first interval is shorter than the second var_dump($diff1 < $diff2); // Oh, that's weird... // Let's peek inside the two intervals var_export($diff1, true); var_export($diff2, true); // Now let's check again var_dump($diff1 < $diff2);
Output for git.master, git.master_jit, rfc.property-hooks
Warning: Cannot compare DateInterval objects in /in/O8Okj on line 10 bool(false) Warning: Cannot compare DateInterval objects in /in/O8Okj on line 18 bool(false)

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