3v4l.org

run code in 300+ PHP versions simultaneously
<?php function foo ($q=1, $e){ } foo(2);
Output for 8.1.0 - 8.1.27, 8.2.0 - 8.2.17, 8.3.0 - 8.3.4
Deprecated: Optional parameter $q declared before required parameter $e is implicitly treated as a required parameter in /in/R114k on line 3 Fatal error: Uncaught ArgumentCountError: Too few arguments to function foo(), 1 passed in /in/R114k on line 7 and exactly 2 expected in /in/R114k:3 Stack trace: #0 /in/R114k(7): foo(2) #1 {main} thrown in /in/R114k on line 3
Process exited with code 255.
Output for 8.0.0 - 8.0.30
Deprecated: Required parameter $e follows optional parameter $q in /in/R114k on line 3 Fatal error: Uncaught ArgumentCountError: Too few arguments to function foo(), 1 passed in /in/R114k on line 7 and exactly 2 expected in /in/R114k:3 Stack trace: #0 /in/R114k(7): foo(2) #1 {main} thrown in /in/R114k on line 3
Process exited with code 255.
Output for 7.1.0 - 7.1.25, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33
Fatal error: Uncaught ArgumentCountError: Too few arguments to function foo(), 1 passed in /in/R114k on line 7 and exactly 2 expected in /in/R114k:3 Stack trace: #0 /in/R114k(7): foo(2) #1 {main} thrown in /in/R114k on line 3
Process exited with code 255.
Output for 7.0.0 - 7.0.20
Warning: Missing argument 2 for foo(), called in /in/R114k on line 7 and defined in /in/R114k on line 3

preferences:
108.98 ms | 401 KiB | 184 Q