bug63734.phpt 467 B

123456789101112131415161718192021222324252627282930
  1. --TEST--
  2. Bug #63734 (Garbage collector can free zvals that are still referenced)
  3. --INI--
  4. zend.enable_gc = 1
  5. --FILE--
  6. <?php
  7. class C {
  8. public $ref;
  9. public $ary;
  10. public function __construct() {
  11. $this->ref = $this;
  12. $this->ary[] = 42;
  13. }
  14. public function __destruct() {
  15. global $ary;
  16. $ary[] = $this->ary[0];
  17. }
  18. }
  19. $c = new C;
  20. unset($c);
  21. gc_collect_cycles();
  22. var_dump($ary);
  23. ?>
  24. --EXPECT--
  25. array(1) {
  26. [0]=>
  27. int(42)
  28. }