3v4l.org

run code in 300+ PHP versions simultaneously
<?php set_error_handler(function($errno, $errstr, $errfile, $errline, $errcontext) { // error was suppressed with the @-operator if (0 === error_reporting()) { return false; } throw new ErrorException($errstr, 0, $errno, $errfile, $errline); }); try { var_dump(fopen('file not exist', 'r')); } catch (Throwable $e) { var_dump($e); }
Output for 8.4.1 - 8.4.14, 8.5.0
object(ArgumentCountError)#2 (7) { ["message":protected]=> string(86) "Too few arguments to function {closure:/in/RhCID:3}(), 4 passed and exactly 5 expected" ["string":"Error":private]=> string(0) "" ["code":protected]=> int(0) ["file":protected]=> string(9) "/in/RhCID" ["line":protected]=> int(3) ["trace":"Error":private]=> array(2) { [0]=> array(2) { ["function"]=> string(21) "{closure:/in/RhCID:3}" ["args"]=> array(4) { [0]=> int(2) [1]=> string(116) "fopen(): open_basedir restriction in effect. File(file not exist) is not within the allowed path(s): (/tmp:/in:/etc)" [2]=> string(9) "/in/RhCID" [3]=> int(13) } } [1]=> array(4) { ["file"]=> string(9) "/in/RhCID" ["line"]=> int(13) ["function"]=> string(5) "fopen" ["args"]=> array(2) { [0]=> string(14) "file not exist" [1]=> string(1) "r" } } } ["previous":"Error":private]=> NULL }
Output for 8.4.15
/bin/php-8.4.15: /usr/lib/libm.so.6: version `GLIBC_2.38' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libm.so.6: version `GLIBC_2.35' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libc.so.6: version `GLIBC_2.34' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libc.so.6: version `GLIBC_2.38' not found (required by /bin/php-8.4.15)
Process exited with code 1.
Output for 8.3.28
/bin/php-8.3.28: /usr/lib/libm.so.6: version `GLIBC_2.38' not found (required by /bin/php-8.3.28) /bin/php-8.3.28: /usr/lib/libm.so.6: version `GLIBC_2.35' not found (required by /bin/php-8.3.28) /bin/php-8.3.28: /usr/lib/libc.so.6: version `GLIBC_2.34' not found (required by /bin/php-8.3.28) /bin/php-8.3.28: /usr/lib/libc.so.6: version `GLIBC_2.38' not found (required by /bin/php-8.3.28)
Process exited with code 1.
Output for 8.0.0 - 8.0.12, 8.0.14 - 8.0.30, 8.1.0 - 8.1.33, 8.2.0 - 8.2.29, 8.3.0 - 8.3.27
object(ArgumentCountError)#2 (7) { ["message":protected]=> string(74) "Too few arguments to function {closure}(), 4 passed and exactly 5 expected" ["string":"Error":private]=> string(0) "" ["code":protected]=> int(0) ["file":protected]=> string(9) "/in/RhCID" ["line":protected]=> int(3) ["trace":"Error":private]=> array(2) { [0]=> array(2) { ["function"]=> string(9) "{closure}" ["args"]=> array(4) { [0]=> int(2) [1]=> string(116) "fopen(): open_basedir restriction in effect. File(file not exist) is not within the allowed path(s): (/tmp:/in:/etc)" [2]=> string(9) "/in/RhCID" [3]=> int(13) } } [1]=> array(4) { ["file"]=> string(9) "/in/RhCID" ["line"]=> int(13) ["function"]=> string(5) "fopen" ["args"]=> array(2) { [0]=> string(14) "file not exist" [1]=> string(1) "r" } } } ["previous":"Error":private]=> NULL }
Output for 8.0.13
object(ArgumentCountError)#2 (7) { ["message":protected]=> string(74) "Too few arguments to function {closure}(), 4 passed and exactly 5 expected" ["string":"Error":private]=> string(0) "" ["code":protected]=> int(0) ["file":protected]=> string(9) "/in/RhCID" ["line":protected]=> int(3) ["trace":"Error":private]=> array(2) { [0]=> array(2) { ["function"]=> string(9) "{closure}" ["args"]=> array(4) { [0]=> int(2) [1]=> string(71) "fopen(file not exist): Failed to open stream: No such file or directory" [2]=> string(9) "/in/RhCID" [3]=> int(13) } } [1]=> array(4) { ["file"]=> string(9) "/in/RhCID" ["line"]=> int(13) ["function"]=> string(5) "fopen" ["args"]=> array(2) { [0]=> string(14) "file not exist" [1]=> string(1) "r" } } } ["previous":"Error":private]=> NULL }
Output for 7.3.32, 7.4.26, 7.4.33
object(ErrorException)#2 (8) { ["message":protected]=> string(71) "fopen(file not exist): failed to open stream: No such file or directory" ["string":"Exception":private]=> string(0) "" ["code":protected]=> int(0) ["file":protected]=> string(9) "/in/RhCID" ["line":protected]=> int(13) ["trace":"Exception":private]=> array(2) { [0]=> array(2) { ["function"]=> string(9) "{closure}" ["args"]=> array(5) { [0]=> int(2) [1]=> string(71) "fopen(file not exist): failed to open stream: No such file or directory" [2]=> string(9) "/in/RhCID" [3]=> int(13) [4]=> array(7) { ["_GET"]=> array(0) { } ["_POST"]=> array(0) { } ["_COOKIE"]=> array(0) { } ["_FILES"]=> array(0) { } ["argv"]=> array(1) { [0]=> string(9) "/in/RhCID" } ["argc"]=> int(1) ["_SERVER"]=> array(17) { ["TERM"]=> string(5) "xterm" ["PATH"]=> string(13) "/usr/bin:/bin" ["LANG"]=> string(1) "C" ["SHELL"]=> string(7) "/bin/sh" ["MAIL"]=> string(16) "/var/mail/nobody" ["LOGNAME"]=> string(6) "nobody" ["USER"]=> string(6) "nobody" ["HOME"]=> string(4) "/tmp" ["PHP_SELF"]=> string(9) "/in/RhCID" ["SCRIPT_NAME"]=> string(9) "/in/RhCID" ["SCRIPT_FILENAME"]=> string(9) "/in/RhCID" ["PATH_TRANSLATED"]=> string(9) "/in/RhCID" ["DOCUMENT_ROOT"]=> string(0) "" ["REQUEST_TIME_FLOAT"]=> float(1609229878.0001) ["REQUEST_TIME"]=> int(1609229878) ["argv"]=> array(1) { [0]=> string(9) "/in/RhCID" } ["argc"]=> int(1) } } } } [1]=> array(4) { ["file"]=> string(9) "/in/RhCID" ["line"]=> int(13) ["function"]=> string(5) "fopen" ["args"]=> array(2) { [0]=> string(14) "file not exist" [1]=> string(1) "r" } } } ["previous":"Exception":private]=> NULL ["severity":protected]=> int(2) }
Output for 7.3.0 - 7.3.31, 7.3.33, 7.4.0 - 7.4.25, 7.4.27 - 7.4.32
object(ErrorException)#2 (8) { ["message":protected]=> string(116) "fopen(): open_basedir restriction in effect. File(file not exist) is not within the allowed path(s): (/tmp:/in:/etc)" ["string":"Exception":private]=> string(0) "" ["code":protected]=> int(0) ["file":protected]=> string(9) "/in/RhCID" ["line":protected]=> int(13) ["trace":"Exception":private]=> array(2) { [0]=> array(2) { ["function"]=> string(9) "{closure}" ["args"]=> array(5) { [0]=> int(2) [1]=> string(116) "fopen(): open_basedir restriction in effect. File(file not exist) is not within the allowed path(s): (/tmp:/in:/etc)" [2]=> string(9) "/in/RhCID" [3]=> int(13) [4]=> array(7) { ["_GET"]=> array(0) { } ["_POST"]=> array(0) { } ["_COOKIE"]=> array(0) { } ["_FILES"]=> array(0) { } ["argv"]=> array(1) { [0]=> string(9) "/in/RhCID" } ["argc"]=> int(1) ["_SERVER"]=> array(17) { ["TERM"]=> string(5) "xterm" ["PATH"]=> string(13) "/usr/bin:/bin" ["LANG"]=> string(1) "C" ["SHELL"]=> string(7) "/bin/sh" ["MAIL"]=> string(16) "/var/mail/nobody" ["LOGNAME"]=> string(6) "nobody" ["USER"]=> string(6) "nobody" ["HOME"]=> string(4) "/tmp" ["PHP_SELF"]=> string(9) "/in/RhCID" ["SCRIPT_NAME"]=> string(9) "/in/RhCID" ["SCRIPT_FILENAME"]=> string(9) "/in/RhCID" ["PATH_TRANSLATED"]=> string(9) "/in/RhCID" ["DOCUMENT_ROOT"]=> string(0) "" ["REQUEST_TIME_FLOAT"]=> float(1609229878.0001) ["REQUEST_TIME"]=> int(1609229878) ["argv"]=> array(1) { [0]=> string(9) "/in/RhCID" } ["argc"]=> int(1) } } } } [1]=> array(4) { ["file"]=> string(9) "/in/RhCID" ["line"]=> int(13) ["function"]=> string(5) "fopen" ["args"]=> array(2) { [0]=> string(14) "file not exist" [1]=> string(1) "r" } } } ["previous":"Exception":private]=> NULL ["severity":protected]=> int(2) }

preferences:
190.49 ms | 430 KiB | 5 Q