- str_repeat: documentation ( source)
- error_get_last: documentation ( source)
- register_shutdown_function: documentation ( source)
- ini_set: documentation ( source)
- error_reporting: documentation ( source)
- set_error_handler: documentation ( source)
<?php
ini_set('display_errors', false);
error_reporting(-1);
set_error_handler(function($code, $string, $file, $line){
throw new ErrorException($string, null, $code, $file, $line);
});
register_shutdown_function(function(){
$error = error_get_last();
if(null !== $error)
{
echo 'Caught at shutdown';
}
});
try
{
while(true)
{
$data .= str_repeat('#', PHP_INT_MAX);
}
}
catch(\Exception $exception)
{
echo 'Caught in try/catch';
}