3v4l.org

run code in 300+ PHP versions simultaneously
<?php function match(string $a, string $b = '') { } match('a', $v['do']);
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
Parse error: syntax error, unexpected token "match", expecting "(" in /in/Fq58u on line 2
Process exited with code 255.
Output for 7.4.0 - 7.4.33
Notice: Undefined variable: v in /in/Fq58u on line 6 Notice: Trying to access array offset on value of type null in /in/Fq58u on line 6 Fatal error: Uncaught TypeError: Argument 2 passed to match() must be of the type string, null given, called in /in/Fq58u on line 6 and defined in /in/Fq58u:2 Stack trace: #0 /in/Fq58u(6): match('a', NULL) #1 {main} thrown in /in/Fq58u on line 2
Process exited with code 255.
Output for 7.3.32 - 7.3.33
Fatal error: Uncaught TypeError: Argument 2 passed to match() must be of the type string, null given, called in /in/Fq58u on line 6 and defined in /in/Fq58u:2 Stack trace: #0 /in/Fq58u(6): match('a', NULL) #1 {main} thrown in /in/Fq58u on line 2
Process exited with code 255.
Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.31
Notice: Undefined variable: v in /in/Fq58u on line 6 Fatal error: Uncaught TypeError: Argument 2 passed to match() must be of the type string, null given, called in /in/Fq58u on line 6 and defined in /in/Fq58u:2 Stack trace: #0 /in/Fq58u(6): match('a', NULL) #1 {main} thrown in /in/Fq58u on line 2
Process exited with code 255.
Output for 5.5.24 - 5.5.35, 5.6.8 - 5.6.28
Fatal error: Default value for parameters with a class type hint can only be NULL in /in/Fq58u on line 2
Process exited with code 255.

preferences:
192.23 ms | 402 KiB | 213 Q