|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #81571 Deprecation error leads to Fatal error?
Submitted: 2021-10-30 12:35 UTC Modified: 2021-11-02 14:07 UTC
From: ondrej at mirtes dot cz Assigned: cmb (profile)
Status: Not a bug Package: *General Issues
PHP Version: 8.1.0RC5 OS: N/A
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
42 + 4 = ?
Subscribe to this entry?

 [2021-10-30 12:35 UTC] ondrej at mirtes dot cz
In my CI build I get this problem:

PHP Fatal error:  During inheritance of ArrayAccess: Uncaught Return type of Hoa\Protocol\Node\Node::offsetExists($  
  name) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChan  
  ge] attribute should be used to temporarily suppress the notice    

So deprecation error somehow gets converted to a fatal error?

Also note that this isn't an issue of an error handler because other deprecation errors are printed without crashing PHP before that too.

Here's the CI pipeline in question:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2021-11-02 11:08 UTC]
-Status: Open +Status: Feedback -Assigned To: +Assigned To: cmb
 [2021-11-02 11:08 UTC]
This looks like a PHPUnit error handler issue.  That deprecation
notice is the first one that is reported[1].  Or am I missing

[1] <>
 [2021-11-02 13:31 UTC] ondrej at mirtes dot cz
-Status: Feedback +Status: Assigned
 [2021-11-02 13:31 UTC] ondrej at mirtes dot cz
What confuses me is the "During inheritance" part of the message which isn't present in the original PHP deprecation error. Do you think that's coming from PHPUnit? I don't see that string when searching my vendor directory.
 [2021-11-02 13:51 UTC]
This happens when a broken error handler converts a deprecation notice into an exception. Exceptions during inheritance are not supported and converted into fatal errors.
 [2021-11-02 13:54 UTC]
-Status: Assigned +Status: Feedback
 [2021-11-02 13:54 UTC]
> What confuses me is the "During inheritance" part of the message
> which isn't present in the original PHP deprecation error.

Ah, right, that is caused by PHP whenever an error handler throws
an exception[1].  This is basically <>.

[1] <>
 [2021-11-02 14:07 UTC]
-Status: Feedback +Status: Not a bug
 [2021-11-02 14:07 UTC]
Oh, I missed Nikita's comment.  So closing as not a bug.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Jun 25 19:01:28 2024 UTC