Skip to content
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

Inconsistency with PHP regarding closures and reflection #3874

Open
anlutro opened this issue Sep 28, 2014 · 1 comment
Open

Inconsistency with PHP regarding closures and reflection #3874

anlutro opened this issue Sep 28, 2014 · 1 comment
Assignees

Comments

@anlutro
Copy link

anlutro commented Sep 28, 2014

new ReflectionFunction($closure) seems to work as expected. However, in one case I am doing $reflectionFunction->getParameters() and then doing $reflectionParameter->getDefiningFunction(), which returns a ReflectionMethod instance in PHP (why not ReflectionFunction? no idea) that behaves differently from the original ReflectionFunction.

  • isClosure() returns false
  • getClosureScopeClass() returns null
  • getDeclaringClass() returns something like "Closure$Namespace\Class::method;0000000".

http://3v4l.org/VgIeT

Some of this behaviour seems really quirky in PHP already and I can't imagine it's a high priority fix, but I thought I'd let you know.

@paulbiss paulbiss self-assigned this Nov 5, 2014
@ecreeth ecreeth mentioned this issue Dec 30, 2019
@lexidor
Copy link
Collaborator

lexidor commented Dec 30, 2019

#8573 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants