3v4l.org

run code in 500+ PHP versions simultaneously
<?php declare(strict_types=1); function acceptArray(array $x) {} try { acceptArray(""); } catch (TypeError $e) { echo get_class($e) . ": " . $e->getMessage() . "\n"; } try { var_dump(locale_compose("")); } catch (TypeError $e) { echo get_class($e) . ": " . $e->getMessage() . "\n"; }
Output for 8.5.0 - 8.5.13, 8.6.0
TypeError: acceptArray(): Argument #1 ($x) must be of type array, string given, called in /in/J2KNm on line 8 Fatal error: Uncaught Error: Call to undefined function locale_compose() in /in/J2KNm:14 Stack trace: #0 {main} thrown in /in/J2KNm on line 14
Process exited with code 255.
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.34, 8.2.0 - 8.2.36, 8.3.0 - 8.3.37, 8.4.1 - 8.4.28
TypeError: acceptArray(): Argument #1 ($x) must be of type array, string given, called in /in/J2KNm on line 8 TypeError: locale_compose(): Argument #1 ($subtags) must be of type array, string given
Output for 7.3.0 - 7.3.33, 7.4.0 - 7.4.33
TypeError: Argument 1 passed to acceptArray() must be of the type array, string given, called in /in/J2KNm on line 8 TypeError: locale_compose() expects parameter 1 to be array, string given

preferences:
19.73 ms | 1170 KiB | 6 Q