-
Notifications
You must be signed in to change notification settings - Fork 7.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
reflection: Fix the return value of ReflectionFunction::{getNamespaceName,inNamespace}() for closures #16129
Conversation
…Name,inNamespace}() for closures Fixes phpGH-16122
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's unfortunate we have an unnoticed BC break after RC, but I agree with your assessment that "namespacename + shortname = name" should be true.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's unfortunate we have an unnoticed BC break after RC
Well, the current output is just broken, so needs to be fixed anyway.
* PHP-8.4: reflection: Fix the return value of ReflectionFunction::{getNamespaceName,inNamespace}() for closures (#16129)
…Name,inNamespace}() for closures (php#16129) * reflection: Fix the return value of ReflectionFunction::{getNamespaceName,inNamespace}() for closures Fixes phpGH-16122 * reflection: Clean up implementation of `ReflectionFunctionAbstract::inNamespace()` * reflection: Clean up implementation of `ReflectionFunctionAbstract::getNamespaceName()`
…Name,inNamespace}() for closures (php#16129) * reflection: Fix the return value of ReflectionFunction::{getNamespaceName,inNamespace}() for closures Fixes phpGH-16122 * reflection: Clean up implementation of `ReflectionFunctionAbstract::inNamespace()` * reflection: Clean up implementation of `ReflectionFunctionAbstract::getNamespaceName()`
Given the (reasonable) assumption that namespacename + shortname = name, the only option is to return an empty namespace and return false when asking if the closure is inside of a namespace.
Fixes GH-16122