mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Merge branch 'PHP-8.1'
* PHP-8.1: Don't implement Stringable on traits
This commit is contained in:
commit
2d38f701e0
6 changed files with 30 additions and 10 deletions
|
@ -2885,7 +2885,8 @@ ZEND_API zend_class_entry *zend_do_link_class(zend_class_entry *ce, zend_string
|
|||
|
||||
/* Normally Stringable is added during compilation. However, if it is imported from a trait,
|
||||
* we need to explicilty add the interface here. */
|
||||
if (ce->__tostring && !zend_class_implements_interface(ce, zend_ce_stringable)) {
|
||||
if (ce->__tostring && !(ce->ce_flags & ZEND_ACC_TRAIT)
|
||||
&& !zend_class_implements_interface(ce, zend_ce_stringable)) {
|
||||
ZEND_ASSERT(ce->__tostring->common.fn_flags & ZEND_ACC_TRAIT_CLONE);
|
||||
ce->ce_flags |= ZEND_ACC_RESOLVED_INTERFACES;
|
||||
ce->num_interfaces++;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue