fork download
  1. <?php
  2.  
  3. function exception_error_handler($errno, $errstr, $errfile, $errline ) {
  4. throw new ErrorException($errstr, $errno, 0, $errfile, $errline);
  5. }
  6. set_error_handler("exception_error_handler");
  7.  
  8. $arr = [];
  9. try {
  10. $d = $arr['not_exists'];
  11. } catch(ErrorException $e) {
  12. echo "Something went wrong...";
  13. }
Success #stdin #stdout 0.01s 20520KB
stdin
Standard input is empty
stdout
Something went wrong...