Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
23 lines (18 sloc) 521 Bytes
<?php
set_error_handler(function (int $level, string $message, string $file, int $line) {
if (error_reporting() === 0) {
return;
}
throw new ErrorException($message, 0, $level, $file, $line);
});
try {
var_dump($array); // not existing variable
} catch (ErrorException $e) {
var_dump($e);
}
try {
$array = [];
var_dump($array['missing-key']); // not existing key
} catch (ErrorException $e) {
var_dump($e);
}
You can’t perform that action at this time.