3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types=1); function myFunc(string $str): void { echo $str; } myFunc(123);
Output for 8.0.1 - 8.0.30, 8.1.0 - 8.1.30, 8.2.0 - 8.2.25, 8.3.0 - 8.3.14
Fatal error: Uncaught TypeError: myFunc(): Argument #1 ($str) must be of type string, int given, called in /in/smJf1 on line 10 and defined in /in/smJf1:5 Stack trace: #0 /in/smJf1(10): myFunc(123) #1 {main} thrown in /in/smJf1 on line 5
Process exited with code 255.
Output for 7.4.0 - 7.4.33
Fatal error: Uncaught TypeError: Argument 1 passed to myFunc() must be of the type string, int given, called in /in/smJf1 on line 10 and defined in /in/smJf1:5 Stack trace: #0 /in/smJf1(10): myFunc(123) #1 {main} thrown in /in/smJf1 on line 5
Process exited with code 255.

preferences:
48 ms | 407 KiB | 5 Q