facebook / facebook/hhvm

Inconsistency with PHP regarding closures and reflection

Aberta
#3,874 1 comentário 0 reações 1 responsável Reivindicada por @paulbiss Ver no GitHub
php5 incompatibility
Linguagem predominante
C++
Estrelas
18.7k
Forks
3.1k
Merge médio
1h 47min
PRs com merge (30d)
2

Descrição

`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.

Guia de contribuição

Abrir o guia de contribuição

Avaliação

Esta issue ainda não foi avaliada.

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.