note 129329 added to class.error
| From: | NoelWhitemore | Date: | Wed, 13 Mar 2024 11:54:48 +0000 |
| Subject: | note 129329 added to class.error | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-221244@lists.php.net to get a copy of this message | ||
The PHP 7 internal error reporting seems quite poor at identifying when the "error" class
has been redeclared. I had an "error" class defined in my application because I use a url
router and this seemed the most obvious name to call my class, then after upgrading to PHP 7 I just
got a blank screen even with all error messages switched on. In the PHP-FPM logs I found this:
PHP Fatal error: Uncaught Error: Wrong parameters for Error([string $message [, long $code [,
Throwable $previo>
Stack trace:
#0 /var/www/html/index.php(24): Error->__construct()
#1 {main}
Note that there's nothing to indicate that the script is trying to redeclare the class, just a
"Wrong parameters" message.
----
Server IP: 45.112.84.4
Probable Submitter: 80.90.13.131 (proxied: 51.9.63.14)
----
Manual Page -- https://php.net/manual/en/class.error.php
Edit -- https://main.php.net/note/edit/129329
Del: integrated -- https://main.php.net/note/delete/129329/integrated
Del: useless -- https://main.php.net/note/delete/129329/useless
Del: bad code -- https://main.php.net/note/delete/129329/bad+code
Del: spam -- https://main.php.net/note/delete/129329/spam
Del: non-english -- https://main.php.net/note/delete/129329/non-english
Del: in docs -- https://main.php.net/note/delete/129329/in+docs
Del: other reasons-- https://main.php.net/note/delete/129329
Reject -- https://main.php.net/note/reject/129329
Search -- https://main.php.net/manage/user-notes.php