mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Don't implement Stringable on traits
Traits do not support interfaces, so we should not implement Stringable on them. Also check the __toString() return type in the same way other magic methods do, otherwise we would now miss the check in the trait case.
This commit is contained in:
parent
7e67366a9b
commit
d478ae73b1
6 changed files with 25 additions and 10 deletions
|
@ -2233,6 +2233,7 @@ ZEND_API void zend_check_magic_method_implementation(const zend_class_entry *ce,
|
|||
zend_check_magic_method_args(0, ce, fptr, error_type);
|
||||
zend_check_magic_method_non_static(ce, fptr, error_type);
|
||||
zend_check_magic_method_public(ce, fptr, error_type);
|
||||
zend_check_magic_method_return_type(ce, fptr, error_type, MAY_BE_STRING);
|
||||
} else if (zend_string_equals_literal(lcname, ZEND_DEBUGINFO_FUNC_NAME)) {
|
||||
zend_check_magic_method_args(0, ce, fptr, error_type);
|
||||
zend_check_magic_method_non_static(ce, fptr, error_type);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue