php-src/Zend/tests/bug78379.phpt
Nikita Popov 9ed2f4898b Don't disable opcache for generic tests
Even if the original issue only reproduces without opcache, we
should still allow running them with and without opcache.
2020-11-04 11:12:12 +01:00

31 lines
427 B
PHP

--TEST--
Bug #78379 (Cast to object confuses GC, causes crash)
--FILE--
<?php
class C {
public function __construct() {
$this->p = (object)["x" => [1]];
}
}
class E {
}
$e = new E;
$e->f = new E;
$e->f->e = $e;
$e->a = new C;
$e = null;
gc_collect_cycles();
var_dump(new C);
?>
--EXPECTF--
object(C)#%d (1) {
["p"]=>
object(stdClass)#%d (1) {
["x"]=>
array(1) {
[0]=>
int(1)
}
}
}