facebook / facebook/hhvm

serialize() fails to preserve object references between invocations of custom serializers

Abierto
#7,253 2 comentarios 0 reacciones 0 asignados Ver en GitHub
php5 incompatibility php7 incompatibility probably easy
Lenguaje dominante
C++
Estrellas
18.7k
Forks
3.1k
Merge medio
1 h 47 min
PR fusionados (30 d)
2

Descripción

Unlike PHP 5.4+, HHVM's implementation of serialize() does not detect and preserve references to the same object between invocations of custom serializers. [PHP Request #36424](https://bugs.php.net/bug.php?id=36424) is probably related.
### HHVM Version

HipHop VM 3.15.0-dev (rel)
Compiler: heads/master-0-g17e1c0b1425733e5f34287b674f2456978c9008b
Repo schema: 7457716dbd7150059b4a315d3f986266d72e8ad8
### Standalone code, or other way to reproduce the problem

https://3v4l.org/t5YP8

```
o = $o;
}
function serialize() {
return serialize([$this->o]);
}
function unserialize($s) {
$this->o = unserialize($s)[0];
}
}
$o = new stdClass;
$r = unserialize(serialize([new A($o), new A($o)]));
var_dump($r[0]->o === $r[1]->o);
```
### Expected result

```
bool(true)
```
### Actual result

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