3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $dateArray1 = [new \DateTimeImmutable('Y-m-d 00:00:00')]; $dateArray2 = [new \DateTimeImmutable('Y-m-d 00:00:00')]; $dates = array_diff($dateArray1, $dateArray2); print_r($dates);
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught Exception: DateTimeImmutable::__construct(): Failed to parse time string (Y-m-d 00:00:00) at position 1 (-): Unexpected character in /in/g8FHg:4 Stack trace: #0 /in/g8FHg(4): DateTimeImmutable->__construct('Y-m-d 00:00:00') #1 {main} thrown in /in/g8FHg on line 4
Process exited with code 255.
Output for 5.5.24 - 5.6.28
Fatal error: Uncaught exception 'Exception' with message 'DateTimeImmutable::__construct(): Failed to parse time string (Y-m-d 00:00:00) at position 1 (-): Unexpected character' in /in/g8FHg:4 Stack trace: #0 /in/g8FHg(4): DateTimeImmutable->__construct('Y-m-d 00:00:00') #1 {main} thrown in /in/g8FHg on line 4
Process exited with code 255.
Output for 5.4.9 - 5.4.45
Fatal error: Class 'DateTimeImmutable' not found in /in/g8FHg on line 4
Process exited with code 255.
Output for 5.3.19 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/g8FHg on line 4
Process exited with code 255.