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 git.master, git.master_jit, rfc.property-hooks
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 }

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
28.22 ms | 409 KiB | 5 Q