Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.php > #18665
| Path | csiph.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail |
|---|---|
| From | Arno Welzel <usenet@arnowelzel.de> |
| Newsgroups | comp.lang.php |
| Subject | Re: set_error_handler(): duplicate error |
| Date | Sun, 20 Jun 2021 12:51:26 +0200 |
| Lines | 84 |
| Message-ID | <ij8kteFp5ocU1@mid.individual.net> (permalink) |
| References | <s9ski4$42b$2@gioia.aioe.org> <iiu6nlForanU1@mid.individual.net> <sai4vp$11n3$1@gioia.aioe.org> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=iso-8859-15 |
| Content-Transfer-Encoding | 7bit |
| X-Trace | individual.net qnBwmHCr8mMqaRoY4z7DqQWUWxUhWCDTVILEBeVXChFuo/pxqb |
| Cancel-Lock | sha1:5sA1BsCLIGAND/sN9oT20JD9PGs= |
| In-Reply-To | <sai4vp$11n3$1@gioia.aioe.org> |
| Xref | csiph.com comp.lang.php:18665 |
Show key headers only | View raw
alex:
> Il 16/06/21 13:48, Arno Welzel ha scritto:
>> I can't reproduce this.
>
> ????
When I run your script, I only get *one* error output, not two.
>> 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?
>
> No.
>
> $ php -v
> PHP 7.4.3 (cli) (built: Oct 6 2020 15:47:56) ( NTS )
> Copyright (c) The PHP Group
> Zend Engine v3.4.0, Copyright (c) Zend Technologies
> with Zend OPcache v7.4.3, Copyright (c), by Zend Technologies
> with Xdebug v2.9.2, Copyright (c) 2002-2020, by Derick Rethans
> tmp.MLHFJ8krVq$ cat test.php
> <?php
> set_error_handler(
> static function (int $severity, string $message, string $file, int
> $line): void {
> throw new InternalErrorException($message, 0, $severity, $file,
> $line);
> }
> );
> xxx();
> tmp.MLHFJ8krVq$ php test.php
>
> Fatal error: Uncaught Error: Call to undefined function xxx() in
> /tmp/tmp.MLHFJ8krVq/test.php on line 7
>
> Error: Call to undefined function xxx() in /tmp/tmp.MLHFJ8krVq/test.php
> on line 7
>
> Call Stack:
> 0.0001 394848 1. {main}() /tmp/tmp.MLHFJ8krVq/test.php:0
Does not happen here:
$ php -v
PHP 7.4.20 (cli) (built: Jun 4 2021 21:24:37) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
with Zend OPcache v7.4.20, Copyright (c), by Zend Technologies
with Xdebug v3.0.4, Copyright (c) 2002-2021, by Derick Rethans
$ cat error-test.php
<?php
set_error_handler(
static function (int $severity, string $message, string $file, int
$line): void {
throw new InternalErrorException($message, 0, $severity, $file,
$line);
}
);
xxx();
$ php error-test.php
$ php error-test.php
PHP Fatal error: Uncaught Error: Call to undefined function xxx() in
/home/arno/error-test.php:7
Stack trace:
#0 {main}
thrown in /home/arno/error-test.php on line 7
So this is a local problem specific to your setup.
--
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