facebook / facebook/hhvm

Invalid default value in a reflection of internal functions

Abierto
#3,138 3 comentarios 0 reacciones 0 asignados Ver en GitHub
low-pri php5 incompatibility
Lenguaje dominante
C++
Estrellas
18.7k
Forks
3.1k
Merge medio
1 h 47 min
PR fusionados (30 d)
2

Descripción

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

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.