3v4l.org

run code in 300+ PHP versions simultaneously
<?php $seconds = 8644372.704; $interval = DateInterval::createFromDateString("$seconds seconds"); $now = new DateTimeImmutable(); $new = $now->add($interval); var_dump($now->diff($new)->days);
Output for git.master, git.master_jit
Warning: DateInterval::createFromDateString(): Unknown or bad format (8644372.704 seconds) at position 4 (3): Unexpected character in /in/UH6kq on line 4 Fatal error: Uncaught TypeError: DateTimeImmutable::add(): Argument #1 ($interval) must be of type DateInterval, bool given in /in/UH6kq:6 Stack trace: #0 /in/UH6kq(6): DateTimeImmutable->add(false) #1 {main} thrown in /in/UH6kq on line 6
Process exited with code 255.
Output for rfc.property-hooks
Fatal error: Uncaught DateMalformedIntervalStringException: Unknown or bad format (8644372.704 seconds) at position 4 (3): Unexpected character in /in/UH6kq:4 Stack trace: #0 /in/UH6kq(4): DateInterval::createFromDateString('8644372.704 sec...') #1 {main} thrown in /in/UH6kq on line 4
Process exited with code 255.

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:
42.55 ms | 401 KiB | 8 Q