You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fatal error: Declaration of EmojiTransliteratorTrait::create(string $id, int $direction = self::FORWARD): EmojiTransliteratorTrait must be compatible with CoreTransliterator::create(string $id, int $direction = self::FORWARD): ?CoreTransliterator
But I expected this output instead:
The code should continue to work. self in a trait should probably not be resolved at compile time.
@Girgias I think this is caused by #15878. The issue is that we're only fixing trait scopes after parent inheritance. Even if self remains unresolved, fn->scope still refers to the trait, which makes the type check fail. The right thing is probably to fix the trait scope before parent inheritance, although this changes behavior for inheritance error messages. It also breaks two tests for edge-cases, which I need to look at.
iluuu1994
added a commit
to iluuu1994/php-src
that referenced
this issue
Apr 10, 2025
Description
The following code:
Resulted in this output:
But I expected this output instead:
The code should continue to work.
self
in a trait should probably not be resolved at compile time.PHP Version
8.5
Operating System
No response
Additional information
The text was updated successfully, but these errors were encountered: