3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types=0); 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.0.0 - 8.0.12, 8.0.14 - 8.0.30, 8.1.0 - 8.1.30, 8.2.0 - 8.2.25, 8.3.0 - 8.3.4, 8.3.6 - 8.3.13
TypeError: acceptArray(): Argument #1 ($x) must be of type array, string given, called in /in/CTrli on line 8 TypeError: locale_compose(): Argument #1 ($subtags) must be of type array, string given
Output for 8.3.5
Warning: PHP Startup: Unable to load dynamic library 'sodium.so' (tried: /usr/lib/php/8.3.5/modules/sodium.so (libsodium.so.23: cannot open shared object file: No such file or directory), /usr/lib/php/8.3.5/modules/sodium.so.so (/usr/lib/php/8.3.5/modules/sodium.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0 TypeError: acceptArray(): Argument #1 ($x) must be of type array, string given, called in /in/CTrli on line 8 TypeError: locale_compose(): Argument #1 ($subtags) must be of type array, string given
Output for 8.0.13
TypeError: acceptArray(): Argument #1 ($x) must be of type array, string given, called in /in/CTrli on line 8 Fatal error: Uncaught Error: Call to undefined function locale_compose() in /in/CTrli:14 Stack trace: #0 {main} thrown in /in/CTrli on line 14
Process exited with code 255.
Output for 7.3.32, 7.4.26, 7.4.33
TypeError: Argument 1 passed to acceptArray() must be of the type array, string given, called in /in/CTrli on line 8 Fatal error: Uncaught Error: Call to undefined function locale_compose() in /in/CTrli:14 Stack trace: #0 {main} thrown in /in/CTrli on line 14
Process exited with code 255.
Output for 7.3.0 - 7.3.31, 7.3.33, 7.4.0 - 7.4.25, 7.4.27 - 7.4.32
TypeError: Argument 1 passed to acceptArray() must be of the type array, string given, called in /in/CTrli on line 8 Warning: locale_compose() expects parameter 1 to be array, string given in /in/CTrli on line 14 bool(false)

preferences:
79.95 ms | 413 KiB | 5 Q