Get all PHP errors/warnings/… that occurred during the current request

后端 未结 5 1661
野性不改
野性不改 2021-02-13 18:07

Setting the directive display_errors to true (while having error_reporting set to E_ALL) prints all errors that occured durin

5条回答
  •  忘了有多久
    2021-02-13 18:47

    Catch the errors as you go and output messages at the end.

    getMessage;
    }
    try{    
      // next bit of code to test
    } catch(\Exception $e) {
      $errors[] = $e->getMessage;
    }
    ...
    
    // display all messages at the end
    echo "\n
    \n";
    print_r($errors);
    echo "\n
    \n";

提交回复
热议问题