3v4l.org

run code in 300+ PHP versions simultaneously
<?php set_error_handler(function(int $severity, string $message, string $filename, int $lineNumber) : void { throw new ErrorException($message, 0, $severity, $filename, $lineNumber); }); function test() : string { return $test; } test();

Abusive script

This script was stopped while abusing our resources

Output for 8.1.25 - 8.1.29, 8.2.12 - 8.2.23, 8.3.0 - 8.3.11
Fatal error: Uncaught ErrorException: Undefined variable $test in /in/Z0bT9:8 Stack trace: #0 /in/Z0bT9(8): {closure}(2, 'Undefined varia...', '/in/Z0bT9', 8) #1 /in/Z0bT9(11): test() #2 {main} thrown in /in/Z0bT9 on line 8
Process exited with code 255.
Output for 7.2.33 - 7.2.34, 7.3.21 - 7.3.23, 7.4.9 - 7.4.11
Fatal error: Uncaught ErrorException: Undefined variable: test in /in/Z0bT9:8 Stack trace: #0 /in/Z0bT9(8): {closure}(8, 'Undefined varia...', '/in/Z0bT9', 8, Array) #1 /in/Z0bT9(11): test() #2 {main} Next TypeError: Return value of test() must be of the type string, null returned in /in/Z0bT9:8 Stack trace: #0 /in/Z0bT9(11): test() #1 {main} thrown in /in/Z0bT9 on line 8
Process exited with code 255.

preferences:
62.66 ms | 651 KiB | 4 Q