svn: /php/php-src/branches/PHP_5_4/ext/spl/tests/ bug53071.phpt

From: Date: Sun, 08 Jan 2012 18:21:13 +0000
Subject: svn: /php/php-src/branches/PHP_5_4/ext/spl/tests/ bug53071.phpt
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-67417@lists.php.net to get a copy of this message
rasmus Sun, 08 Jan 2012 18:21:13 +0000 Revision: http://svn.php.net/viewvc?view=revision&revision=321934 Log: This test only works if gc is enabled Changed paths: U php/php-src/branches/PHP_5_4/ext/spl/tests/bug53071.phpt Modified: php/php-src/branches/PHP_5_4/ext/spl/tests/bug53071.phpt =================================================================== --- php/php-src/branches/PHP_5_4/ext/spl/tests/bug53071.phpt 2012-01-08 18:03:56 UTC (rev 321933) +++ php/php-src/branches/PHP_5_4/ext/spl/tests/bug53071.phpt 2012-01-08 18:21:13 UTC (rev 321934) @@ -1,26 +1,27 @@ ---TEST-- -Bug #53071 (Usage of SPLObjectStorage defeats gc_collect_cycles) ---FILE-- -<?php -class myClass -{ - public $member; -} -function LimitedScope() -{ - $myA = new myClass(); - $myB = new SplObjectStorage(); - $myC = new myClass(); - $myC->member = $myA; // myC has a referece to myA - $myB->Attach($myC); // myB attaches myC - $myA->member = $myB; // myA has myB, comleting the cycle -} -LimitedScope(); -var_dump(gc_collect_cycles()); - -echo "Done.\n"; - -?> ---EXPECTF-- -int(5) -Done. +--TEST-- +Bug #53071 (Usage of SPLObjectStorage defeats gc_collect_cycles) +--FILE-- +<?php +gc_enable(); +class myClass +{ + public $member; +} +function LimitedScope() +{ + $myA = new myClass(); + $myB = new SplObjectStorage(); + $myC = new myClass(); + $myC->member = $myA; // myC has a referece to myA + $myB->Attach($myC); // myB attaches myC + $myA->member = $myB; // myA has myB, comleting the cycle +} +LimitedScope(); +var_dump(gc_collect_cycles()); + +echo "Done.\n"; + +?> +--EXPECTF-- +int(5) +Done.

« previous php.cvs (#67417) next »