rasmus Sun, 08 Jan 2012 18:22:50 +0000 Revision: http://svn.php.net/viewvc?view=revision&revision=321935
Log: Make sure gc is enabled Changed paths: U php/php-src/branches/PHP_5_3/ext/spl/tests/bug53071.phpt U php/php-src/trunk/ext/spl/tests/bug53071.phpt Modified: php/php-src/branches/PHP_5_3/ext/spl/tests/bug53071.phpt =================================================================== --- php/php-src/branches/PHP_5_3/ext/spl/tests/bug53071.phpt 2012-01-08 18:21:13 UTC (rev 321934) +++ php/php-src/branches/PHP_5_3/ext/spl/tests/bug53071.phpt 2012-01-08 18:22:50 UTC (rev 321935) @@ -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. Modified: php/php-src/trunk/ext/spl/tests/bug53071.phpt =================================================================== --- php/php-src/trunk/ext/spl/tests/bug53071.phpt 2012-01-08 18:21:13 UTC (rev 321934) +++ php/php-src/trunk/ext/spl/tests/bug53071.phpt 2012-01-08 18:22:50 UTC (rev 321935) @@ -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.
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php