/
vshmidt
/
php
Обзор
Документация
Войти
/
vshmidt
/
php
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
ext/reflection/tests/ReflectionClass_isIterable_gh20217.phpt
38 строк
799 B
Alexandre Daubois
Fix GH-20217: ReflectionClass::isIterable() should return false for classes with property hooks (#20241)
22 окт 2025, 11:01
Не верифицирован
22 окт 2025, 11:01
572652e
Код
Авторство
О чём код?
--TEST-- GH-20217 (ReflectionClass::isIterable() should return false for classes with property hooks) --FILE-- <?php class ClassWithPropertyHooks { public string $name { get => 'virtual'; } } class IterableClassWithPropertyHooks implements IteratorAggregate { public string $name { get => 'virtual'; } public function getIterator(): Traversable { return new ArrayIterator([]); } } $classes = [ 'ClassWithPropertyHooks' => false, 'IterableClassWithPropertyHooks' => true, ]; foreach ($classes as $className => $expected) { $status = (new ReflectionClass($className)->isIterable() === $expected) ? 'PASS' : 'FAIL'; echo "$className: $status\n"; } ?> --EXPECT-- ClassWithPropertyHooks: PASS IterableClassWithPropertyHooks: PASS