Why do undefined index errors in the lumen framework throw exceptions?

<?php
    $a = array();
    $b = $a["test"];
?>

when the above code is executed alone, it will only be reported: PHP Notice: Undefined index: test in / private/var/folders/lr/hbwptx4s1017kl_hlr4d9b4r0000gn/T/CodeRunner/Untitled.php on line 3

but a ErrorException exception is thrown in the lumen framework:

(1/1) ErrorException
Undefined index: test

in ExampleController.php (line 23)
at Application->Laravel\Lumen\Concerns\{closure}(8, "Undefined index: test", "/Users/kai/work/api/app/Http/Controllers/ExampleController.php", 23, array())
in ExampleController.php (line 23)
at ExampleController->testOrder()
at call_user_func_array(array(object(ExampleController), "testOrder"), array())
in BoundMethod.php (line 29)
Mar.06,2021

because error_reporting (- 1); is set, and then use set_error_handler to handle errors and throw an exception during handling.

related codes in IlluminateFoundationBootstrapHandleExceptions::bootstrap

Menu