2 Test ErrorHandler in case of fatal error
4 <?php if (!extension_loaded('symfony_debug')) {
14 const EMERGENCY = 'emergency';
15 const ALERT = 'alert';
16 const CRITICAL = 'critical';
17 const ERROR = 'error';
18 const WARNING = 'warning';
19 const NOTICE = 'notice';
21 const DEBUG = 'debug';
24 namespace Symfony\Component\Debug;
26 $dir = __DIR__.'/../../../';
27 require $dir.'ErrorHandler.php';
28 require $dir.'Exception/FatalErrorException.php';
29 require $dir.'Exception/UndefinedFunctionException.php';
30 require $dir.'FatalErrorHandler/FatalErrorHandlerInterface.php';
31 require $dir.'FatalErrorHandler/ClassNotFoundFatalErrorHandler.php';
32 require $dir.'FatalErrorHandler/UndefinedFunctionFatalErrorHandler.php';
33 require $dir.'FatalErrorHandler/UndefinedMethodFatalErrorHandler.php';
45 $handler = ErrorHandler::register();
46 $handler->setExceptionHandler('print_r');
48 if (function_exists('xdebug_disable')) {
55 Fatal error: Call to undefined function Symfony\Component\Debug\notexist() in %s on line %d
56 Symfony\Component\Debug\Exception\UndefinedFunctionException Object
58 [message:protected] => Attempted to call function "notexist" from namespace "Symfony\Component\Debug".
59 [string:Exception:private] =>
61 [file:protected] => %s
62 [line:protected] => %d
63 [trace:Exception:private] => Array
67 %A [function] => Symfony\Component\Debug\foo
76 %A [function] => Symfony\Component\Debug\bar
85 [previous:Exception:private] =>
86 [severity:protected] => 1