Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.programming > #13065

set_error_handler(): duplicate error

From alex <1j9448a02@lnx159sneakemail.com.invalid>
Newsgroups comp.programming
Subject set_error_handler(): duplicate error
Date 2021-06-10 11:03 +0200
Organization Aioe.org NNTP Server
Message-ID <s9skhf$42b$1@gioia.aioe.org> (permalink)

Show all headers | View raw


<?php
//error_reporting(0);
set_error_handler(
     static function (int $severity, string $message, string $file, int 
$line): void {
         throw new InternalErrorException($message, 0, $severity, $file, 
$line);
     }
);

xxx();

Output:

Fatal error: Uncaught Error: Call to undefined function xxx() in 
/tmp/tmp.Ie1UVhkWcT/test.php on line 9

Error: Call to undefined function xxx() in /tmp/tmp.Ie1UVhkWcT/test.php 
on line 9

Call Stack:
     0.0001     392928   1. {main}() /tmp/tmp.Ie1UVhkWcT/test.php:0

Why error message showing is duplicate?
Furthermore, if uncommenting the error_reporting(0) instruction does not 
show any errors.
is there a good compromise?

Back to comp.programming | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

set_error_handler(): duplicate error alex <1j9448a02@lnx159sneakemail.com.invalid> - 2021-06-10 11:03 +0200
  Re: set_error_handler(): duplicate error Härra Ramob <ya12983@mail.com> - 2022-01-05 00:32 -0800

csiph-web