mirror of
https://github.com/php/php-src.git
synced 2024-12-25 01:40:50 +08:00
29 lines
440 B
PHP
29 lines
440 B
PHP
--TEST--
|
|
Bug #63734 (Garbage collector can free zvals that are still referenced)
|
|
--FILE--
|
|
<?php
|
|
class C {
|
|
public $ref;
|
|
public $ary;
|
|
public function __construct() {
|
|
$this->ref = $this;
|
|
$this->ary[] = 42;
|
|
}
|
|
public function __destruct() {
|
|
global $ary;
|
|
$ary[] = $this->ary[0];
|
|
}
|
|
}
|
|
|
|
$c = new C;
|
|
unset($c);
|
|
gc_collect_cycles();
|
|
|
|
var_dump($ary);
|
|
?>
|
|
--EXPECT--
|
|
array(1) {
|
|
[0]=>
|
|
int(42)
|
|
}
|