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
{{ message }}
Repository navigation
ReflectionFunction::getNamespaceName() is broken for closures with PHP8.4 #16122
The name was previously Foo\{closure}, and is now {closure:Foo\Bar::testClass():9}. It seems this is related to #13550. Hence, the logic in ReflectionFunctionAbstract::getNamespaceName() is now broken, as it's looking for the first \ and, if present, returning everything up to it. /cc @TimWolla
Activity
iluuu1994 commentedon Sep 29, 2024
The output is definitely bad, but closures don't have a namespace. Not sure what the correct output would be. Related to #12907.
iluuu1994 commentedon Sep 29, 2024
Oh, I see this only changed in 8.4.
iluuu1994 commentedon Sep 29, 2024
The name was previously
Foo\{closure}, and is now{closure:Foo\Bar::testClass():9}. It seems this is related to #13550. Hence, the logic inReflectionFunctionAbstract::getNamespaceName()is now broken, as it's looking for the first\and, if present, returning everything up to it. /cc @TimWollaphp-src/ext/reflection/php_reflection.c
Lines 3605 to 3610 in 1da352c
TimWolla commentedon Sep 29, 2024
Related to #14001 (which fixed it for
getShortName()) and #14087 which follow-up fixed that for FCC. I'll send a PR tomorrow.TimWolla commentedon Sep 30, 2024
This also affects
inNamespace(). My PR will fix both.reflection: Fix the return value of ReflectionFunction::{getNamespace…
reflection: Fix the return value of ReflectionFunction::{getNamespace…