com php-src: Addef test for bug #63734 (Garbage collector can free zvals that are still referenced): NEWS Zend/tests/bug63734.phpt

From: Date: Wed, 08 Apr 2015 19:18:10 +0000
Subject: com php-src: Addef test for bug #63734 (Garbage collector can free zvals that are still referenced): NEWS Zend/tests/bug63734.phpt
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-86140@lists.php.net to get a copy of this message
Commit: e1d6b24da82df3f71fa7a9470cb348f5092b3492 Author: Dmitry Stogov <dmitry@zend.com> Wed, 8 Apr 2015 22:18:10 +0300 Parents: 91e84bb168693b27547136276c0777ed1fd8ddeb Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=e1d6b24da82df3f71fa7a9470cb348f5092b3492 Log: Addef test for bug #63734 (Garbage collector can free zvals that are still referenced) Bugs: https://bugs.php.net/63734 Changed paths: M NEWS A Zend/tests/bug63734.phpt Diff: diff --git a/NEWS b/NEWS index 67c7d53..6dfb040 100644 --- a/NEWS +++ b/NEWS @@ -35,6 +35,8 @@ . Fixed bug #65419 (Inside trait, self::class != __CLASS__). (Julien) . Fixed bug #65576 (Constructor from trait conflicts with inherited constructor). (dunglas at gmail dot com) + . Fixed bug #63734 (Garbage collector can free zvals that are still + referenced). (Dmitry) . Removed ZEND_ACC_FINAL_CLASS, promoting ZEND_ACC_FINAL as final class modifier. (Guilherme Blanco) . is_long() & is_integer() is now an alias of is_int(). (Kalle) diff --git a/Zend/tests/bug63734.phpt b/Zend/tests/bug63734.phpt new file mode 100644 index 0000000..8e5ee6d --- /dev/null +++ b/Zend/tests/bug63734.phpt @@ -0,0 +1,28 @@ +--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) +}

« previous php.cvs (#86140) next »