3v4l.org

run code in 300+ PHP versions simultaneously
<?php $old_error = error_reporting(); $new_old_error = null; $bool = false; $string = ''; $get_last = array(); // error handler function function myErrorHandler($errno, $errstr, $errfile, $errline) { global $new_old_error, $bool, $string, $get_last; $new_old_error = error_reporting(); if (!($new_old_error & $errno)) { // This error code is not included in error_reporting, so let it fall // through to the standard PHP error handler $get_last[] = error_get_last(); error_clear_last(); } else { // $errstr may need to be escaped: $errstr = htmlspecialchars($errstr); switch ($errno) { case E_USER_ERROR: $string = $string . "<b>My ERROR</b> [$errno] $errstr<br />\n"; $string = $string . " Fatal error on line $errline in file $errfile"; $string = $string . ", PHP " . PHP_VERSION . " (" . PHP_OS . ")<br />\n"; $string = $string . "Aborting...<br />\n"; exit(1); case E_USER_WARNING: $string = $string . "<b>My WARNING</b> [$errno] $errstr<br />\n"; break; case E_USER_NOTICE: $string = $string . "<b>My NOTICE</b> [$errno] $errstr<br />\n"; break; default: $string = $string . "Unknown error type: [$errno] $errstr<br />\n"; break; } /* Don't execute PHP internal error handler */ $bool = true; } return $bool; } $old_error_handler = set_error_handler("myErrorHandler"); @$arr['is']; var_dump($string, $get_last, error_get_last());
Output for git.master_jit, git.master, rfc.property-hooks
string(0) "" array(2) { [0]=> NULL [1]=> array(4) { ["type"]=> int(2) ["message"]=> string(23) "Undefined variable $arr" ["file"]=> string(9) "/in/eRbUu" ["line"]=> int(51) } } array(4) { ["type"]=> int(2) ["message"]=> string(37) "Trying to access array offset on null" ["file"]=> string(9) "/in/eRbUu" ["line"]=> int(51) }

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:
27.66 ms | 406 KiB | 5 Q