3v4l.org

run code in 300+ PHP versions simultaneously
<?php function test(DateTime $dt) {} test(new DateTimeImmutable());
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.30, 8.2.0 - 8.2.24, 8.3.0 - 8.3.12
Fatal error: Uncaught TypeError: test(): Argument #1 ($dt) must be of type DateTime, DateTimeImmutable given, called in /in/4GSjI on line 5 and defined in /in/4GSjI:3 Stack trace: #0 /in/4GSjI(5): test(Object(DateTimeImmutable)) #1 {main} thrown in /in/4GSjI on line 3
Process exited with code 255.
Output for 7.1.25 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33
Fatal error: Uncaught TypeError: Argument 1 passed to test() must be an instance of DateTime, instance of DateTimeImmutable given, called in /in/4GSjI on line 5 and defined in /in/4GSjI:3 Stack trace: #0 /in/4GSjI(5): test(Object(DateTimeImmutable)) #1 {main} thrown in /in/4GSjI on line 3
Process exited with code 255.

preferences:
62.6 ms | 408 KiB | 5 Q