3v4l.org

run code in 300+ PHP versions simultaneously
<?php function foo(bool $xxx){ var_dump($xxx); } function bar($xxx = true){ foo(...func_get_args()); } bar();
Output for 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.34, 8.2.0 - 8.2.30, 8.3.0 - 8.3.30, 8.4.1 - 8.4.18, 8.5.0 - 8.5.3
Fatal error: Uncaught ArgumentCountError: Too few arguments to function foo(), 0 passed in /in/A3RO1 on line 8 and exactly 1 expected in /in/A3RO1:3 Stack trace: #0 /in/A3RO1(8): foo() #1 /in/A3RO1(11): bar() #2 {main} thrown in /in/A3RO1 on line 3
Process exited with code 255.
Output for 7.0.0 - 7.0.23
Fatal error: Uncaught TypeError: Argument 1 passed to foo() must be of the type boolean, none given, called in /in/A3RO1 on line 8 and defined in /in/A3RO1:3 Stack trace: #0 /in/A3RO1(8): foo() #1 /in/A3RO1(11): bar() #2 {main} thrown in /in/A3RO1 on line 3
Process exited with code 255.

preferences:
91.31 ms | 1733 KiB | 4 Q