3v4l.org

run code in 300+ PHP versions simultaneously
<?php $callback = function () { echo 'test'; function test(boolean $parameter) { echo 'test2'; } test(true); }; $callback();
Output for 8.3.0 - 8.3.13
Warning: "boolean" will be interpreted as a class name. Did you mean "bool"? Write "\boolean" to suppress this warning in /in/bjv0n on line 6 test Fatal error: Uncaught TypeError: test(): Argument #1 ($parameter) must be of type boolean, true given, called in /in/bjv0n on line 11 and defined in /in/bjv0n:6 Stack trace: #0 /in/bjv0n(11): test(true) #1 /in/bjv0n(14): {closure}() #2 {main} thrown in /in/bjv0n on line 6
Process exited with code 255.
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.30, 8.2.0 - 8.2.25
Warning: "boolean" will be interpreted as a class name. Did you mean "bool"? Write "\boolean" to suppress this warning in /in/bjv0n on line 6 test Fatal error: Uncaught TypeError: test(): Argument #1 ($parameter) must be of type boolean, bool given, called in /in/bjv0n on line 11 and defined in /in/bjv0n:6 Stack trace: #0 /in/bjv0n(11): test(true) #1 /in/bjv0n(14): {closure}() #2 {main} thrown in /in/bjv0n on line 6
Process exited with code 255.
Output for 7.3.0 - 7.3.33, 7.4.0 - 7.4.33
test Fatal error: Uncaught TypeError: Argument 1 passed to test() must be an instance of boolean, bool given, called in /in/bjv0n on line 11 and defined in /in/bjv0n:6 Stack trace: #0 /in/bjv0n(11): test(true) #1 /in/bjv0n(14): {closure}() #2 {main} thrown in /in/bjv0n on line 6
Process exited with code 255.
Output for 7.0.0 - 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33
test Fatal error: Uncaught TypeError: Argument 1 passed to test() must be an instance of boolean, boolean given, called in /in/bjv0n on line 11 and defined in /in/bjv0n:6 Stack trace: #0 /in/bjv0n(11): test(true) #1 /in/bjv0n(14): {closure}() #2 {main} thrown in /in/bjv0n on line 6
Process exited with code 255.
Output for 5.6.0 - 5.6.40
test Catchable fatal error: Argument 1 passed to test() must be an instance of boolean, boolean given, called in /in/bjv0n on line 11 and defined in /in/bjv0n on line 6
Process exited with code 255.

preferences:
66.37 ms | 412 KiB | 5 Q