Retain class_exists expression types in closure#5746
Conversation
|
Shouldnt be the same with trait exist and unterface exist and enum exists ? |
VincentLanglet
left a comment
There was a problem hiding this comment.
Might be more place to check ?
-
MutatingScope::rememberConstructorExpressions: Check class_exists and function_exists but not other
_existsfunction -
MutatingScope::isInClassExists: Check class_exists, enum_exists, interface_exists ; seems ok according to the name of method at first sight but looking at
ClassExistsFunctionTypeSpecifyingExtensionwe should maybe add enum_exists to be similar.
agree - but I think these are problems for a separate PR
yeah need to be explored separately |
|
Did you check this new error @staabm ? https://github.com/phpstan/phpstan-src/actions/runs/26359187340/job/77591608540?pr=5746 Edit: Seems like related to https://github.com/briannesbitt/Carbon/blob/0b004790c36cd389cc64dd928434fb17d477fe2b/src/Carbon/Lang/sr_Latn_BA.php#L17 |
looked into it. I don't see a use-case yet, which would be improved when we remember also e.g.
|
|
analog #1929
class_exists()is special, because there's no way to unload a class in PHP, so it should "survive" when entering closure.