[php-src] PR #21712: Fix GH-21699: callable resolution must fail if error handler threw during self/parent/static deprecations
| From: | macoaure | Date: | Fri, 10 Apr 2026 17:38:33 +0000 |
| Subject: | [php-src] PR #21712: Fix GH-21699: callable resolution must fail if error handler threw during self/parent/static deprecations | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-35661@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/21712
Author: macoaure
This pull request addresses a bug (GH-21699) where an assertion failure could occur in
shutdown_executor if an error handler throws an exception during the resolution of
self::, parent::, or static:: callables. The fix ensures that
if an exception is thrown by a user-defined error handler during callable resolution, the callable
is not incorrectly reported as valid. The PR also adds comprehensive tests to cover these scenarios.
Bug fix for callable resolution:
* Updated zend_is_callable_check_class in Zend/zend_API.c to check for
exceptions after error handlers run, preventing invalid callables from being reported as valid if an
exception was thrown.
Tests for error handler behavior:
* Added Zend/tests/gh_21699.phpt to test self:: callable resolution when
the error handler throws.
* Added Zend/tests/gh_21699_parent.phpt to test parent:: callable
resolution with throwing error handler.
* Added Zend/tests/gh_21699_static.phpt to test static:: callable
resolution with throwing error handler.
Documentation:
* Updated NEWS to document the bug fix for assertion failures in
shutdown_executor during callable resolution with throwing error handlers.