Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.php > #18659
| From | Arno Welzel <usenet@arnowelzel.de> |
|---|---|
| Newsgroups | comp.lang.php |
| Subject | Re: set_error_handler(): duplicate error |
| Date | 2021-06-16 13:48 +0200 |
| Message-ID | <iiu6nlForanU1@mid.individual.net> (permalink) |
| References | <s9ski4$42b$2@gioia.aioe.org> |
alex:
> <?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?
I can't reproduce this. When I run this script with PHP 7.4 as CLI, I
only get the expected result:
PHP Fatal error: Uncaught Error: Call to undefined function xxx() in
D:\test-errorhandler.php:11
Stack trace:
#0 {main}
thrown in D:\test-errorhandler.php on line 11
Do you run the above script within a larger application which already
has some kind of error handling in place?
--
Arno Welzel
https://arnowelzel.de
Back to comp.lang.php | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
set_error_handler(): duplicate error alex <1j9448a02@lnx159sneakemail.com.invalid> - 2021-06-10 11:04 +0200
Re: set_error_handler(): duplicate error Ii Ii <ya12983@mail.com> - 2021-06-16 02:39 -0700
Re: set_error_handler(): duplicate error Arno Welzel <usenet@arnowelzel.de> - 2021-06-16 13:48 +0200
Re: set_error_handler(): duplicate error alex <1j9448a02@lnx159sneakemail.com.invalid> - 2021-06-18 14:53 +0200
Re: set_error_handler(): duplicate error Jerry Stuckle <jstucklex@attglobal.net> - 2021-06-18 22:00 -0400
Re: set_error_handler(): duplicate error alex <1j9448a02@lnx159sneakemail.com.invalid> - 2021-06-19 16:41 +0200
Re: set_error_handler(): duplicate error Jerry Stuckle <jstucklex@attglobal.net> - 2021-06-19 19:21 -0400
Re: set_error_handler(): duplicate error Arno Welzel <usenet@arnowelzel.de> - 2021-06-20 13:10 +0200
Re: set_error_handler(): duplicate error Arno Welzel <usenet@arnowelzel.de> - 2021-06-20 13:02 +0200
Re: set_error_handler(): duplicate error Arno Welzel <usenet@arnowelzel.de> - 2021-06-20 12:51 +0200
Re: set_error_handler(): duplicate error alex <1j9448a02@lnx159sneakemail.com.invalid> - 2021-06-21 17:06 +0200
Re: set_error_handler(): duplicate error Arno Welzel <usenet@arnowelzel.de> - 2021-06-21 19:43 +0200
Re: set_error_handler(): duplicate error alex <1j9448a02@lnx159sneakemail.com.invalid> - 2021-06-22 16:10 +0200
Re: set_error_handler(): duplicate error "J.O. Aho" <user@example.net> - 2021-06-22 18:13 +0200
Re: set_error_handler(): duplicate error alex <1j9448a02@lnx159sneakemail.com.invalid> - 2021-06-23 13:35 +0200
Re: set_error_handler(): duplicate error Arno Welzel <usenet@arnowelzel.de> - 2021-06-23 10:24 +0200
csiph-web