Skip to content

Fix GH-25228: Segfault in IteratorIterator with abstract IteratorAggregate - #25230

Open
lazerg wants to merge 1 commit into
php:PHP-8.4from
lazerg:fix/gh-25228-abstract-aggregate
Open

lazerg wants to merge 1 commit into
php:PHP-8.4from
lazerg:fix/gh-25228-abstract-aggregate

Conversation

@lazerg

@lazerg lazerg commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

When $class names an abstract class, spl_get_iterator_from_aggregate() calls that class's getIterator() directly, which is still the abstract one. That skips the usual abstract check, so the internal IteratorAggregate::getIterator() crashes with a NULL handler and a userland abstract one runs with no body. It now throws the same "Cannot call abstract method" Error a normal call would.

Fixes #25228

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant