1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00
Files
archived-php-src/ext/intl/tests/IntlIterator_cycle_management.phpt
Niels Dossche ee2faaa423 Handle GC cycles properly in intl iterators
This is a follow-up on GH-17343 to implement GC cycle management.
Previously the objects lived too long due to the strong cycle.
This patch adds get_gc handlers to break the cycle.

Closes GH-17355.
2025-01-04 17:42:18 +01:00

20 lines
323 B
PHP

--TEST--
IntlIterator cycle management
--EXTENSIONS--
intl
--FILE--
<?php
function break_cycle_test() {
$obj = IntlCalendar::getKeywordValuesForLocale('calendar', 'fa_IR', true);
unset($obj);
var_dump(gc_collect_cycles());
}
break_cycle_test();
break_cycle_test();
break_cycle_test();
?>
--EXPECT--
int(1)
int(1)
int(1)