mirror of
https://github.com/php/php-src.git
synced 2024-12-17 22:09:12 +08:00
9ed2f4898b
Even if the original issue only reproduces without opcache, we should still allow running them with and without opcache.
31 lines
427 B
PHP
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)
|
|
}
|
|
}
|
|
}
|