3v4l.org

run code in 500+ PHP versions simultaneously
<?php class MyDateTimeImmutableMidnightUTC extends \DateTimeImmutable { public function __construct(string $datetime) { parent::__construct($datetime, new \DateTimeZone('UTC')); $time = $this->format('H:i:s'); if ($time !== '00:00:00') { throw new RuntimeException("Midnight UTC datetime called with a non-midnight time! datetime: $datetime time: $time"); } } } new MyDateTimeImmutableMidnightUTC('2000-01-01 00:00'); new MyDateTimeImmutableMidnightUTC('2000-01-01 00:10');
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught RuntimeException: Midnight UTC datetime called with a non-midnight time! datetime: 2000-01-01 00:10 time: 00:10:00 in /in/UdMcb:8 Stack trace: #0 /in/UdMcb(14): MyDateTimeImmutableMidnightUTC->__construct('2000-01-01 00:1...') #1 {main} thrown in /in/UdMcb on line 8
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:
98.42 ms | 1302 KiB | 4 Q