Invalid default value in a reflection of internal functions
- Linguagem predominante
- C++
- Estrelas
- 18.7k
- Forks
- 3.1k
- Merge médio
- 1h 47min
- PRs com merge (30d)
- 2
Descrição
Default values of some arguments of internal functions are variable. For example arguments of `gmmktime` function depend on actual time. The methods `ReflectionParameter::isDefaultValueAvailable()` and `ReflectionParameter::getDefaultValue()` are poorly implemented in HHVM.
http://3v4l.org/t8M6E
``` php
$ref = new ReflectionFunction('gmmktime');
$params = $ref->getParameters();
$param = reset($params);
var_dump($param->isOptional(), $param->isDefaultValueAvailable());
if ($param->isDefaultValueAvailable()) {
var_dump($param->getDefaultValue());
}
```
HHVM
```
bool(true)
bool(true) # should be false
int(2147483647) # absolutely wrong value
```
PHP
```
bool(true)
bool(false)
```
Guia de contribuição
Avaliação
Esta issue ainda não foi avaliada.