3v4l.org

run code in 300+ PHP versions simultaneously
<?php function a(array $a) { } try { a('s'); } catch (\Exception) {}
Output for 8.1.23 - 8.1.28, 8.2.10 - 8.2.18, 8.3.0 - 8.3.7
Fatal error: Uncaught TypeError: a(): Argument #1 ($a) must be of type array, string given, called in /in/6cmYP on line 6 and defined in /in/6cmYP:2 Stack trace: #0 /in/6cmYP(6): a('s') #1 {main} thrown in /in/6cmYP on line 2
Process exited with code 255.
Output for 5.4.0 - 5.4.25, 5.5.0 - 5.5.9
Parse error: syntax error, unexpected ')', expecting variable (T_VARIABLE) in /in/6cmYP on line 7
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected ')', expecting T_VARIABLE in /in/6cmYP on line 7
Process exited with code 255.

preferences:
81.37 ms | 401 KiB | 93 Q