3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $date = new DateTimeImmutable(123456789); var_dump($date->format('Y-m-d H:i:s')); var_dump($date);
Output for 7.0.0 - 7.3.0rc4
Fatal error: Uncaught Exception: DateTimeImmutable::__construct(): Failed to parse time string (123456789) at position 6 (7): Unexpected character in /in/PkopM:2 Stack trace: #0 /in/PkopM(2): DateTimeImmutable->__construct('123456789') #1 {main} thrown in /in/PkopM on line 2
Process exited with code 255.
Output for 5.5.0 - 5.6.28
Fatal error: Uncaught exception 'Exception' with message 'DateTimeImmutable::__construct(): Failed to parse time string (123456789) at position 6 (7): Unexpected character' in /in/PkopM:2 Stack trace: #0 /in/PkopM(2): DateTimeImmutable->__construct('123456789') #1 {main} thrown in /in/PkopM on line 2
Process exited with code 255.
Output for 5.2.3 - 5.4.45
Fatal error: Class 'DateTimeImmutable' not found in /in/PkopM on line 2
Process exited with code 255.
Output for 5.0.0 - 5.2.2
<br /> <b>Fatal error</b>: Class 'DateTimeImmutable' not found in <b>/in/PkopM</b> on line <b>2</b><br />
Process exited with code 255.
Output for 4.3.2 - 4.4.9
<br /> <b>Fatal error</b>: Cannot instantiate non-existent class: datetimeimmutable in <b>/in/PkopM</b> on line <b>2</b><br />
Process exited with code 255.
Output for 4.3.0 - 4.3.1
<br /> <b>Fatal error</b>: Cannot instantiate non-existent class: datetimeimmutable in <b>/in/PkopM</b> on line <b>2</b><br />