[php-src] PR #17385: Allow Throwable to be extended outside of Exception
| From: | vishwamartur | Date: | Mon, 06 Jan 2025 16:31:54 +0000 |
| Subject: | [php-src] PR #17385: Allow Throwable to be extended outside of Exception | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-30277@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/17385
Author: vishwamartur
Related to #17233
Allow
\Throwable to be extended directly without causing a Fatal error.
* **Zend/zend_exceptions.c**
- Remove the restriction in zend_implement_throwable function that checks if a class
implementing \Throwable extends Exception or Error.
- Update the zend_register_default_exception function to register the
zend_ce_throwable interface without the restriction.
* **Zend/tests/bug_test.phpt**
- Add a new test file to ensure that extending \Throwable directly works as expected.
- Add a test case to check if a class can extend \Throwable directly without causing
a Fatal error.
- Add a test case to check if a class extending \Throwable directly can implement the
required methods.