Skip to content

Conversation

alexandre-daubois
Copy link
Member

No description provided.

@iluuu1994
Copy link
Member

It's worth noting this has some impact on other internal classes that set get_iterator but don't implement Iterator or IteratorAggregate. There are at least a handful of those in ext/com_dotnet and ext/ffi. Not a big issue, just worth pointing out. I'm also not sure if this is a 8.4-only issue, so it should target either 8.3 or 8.5 (or master).

@alexandre-daubois
Copy link
Member Author

As it only reported to cause problems with hooks, I'd say 8.4 is the right target?

@iluuu1994
Copy link
Member

iluuu1994 commented Oct 20, 2025

There are other classes with get_iterator that don't implement Traversable, so this will change behavior for 8.4 but not 8.3, which seems odd, if that interpretation of "is iterable" is wrong.

@alexandre-daubois alexandre-daubois force-pushed the iterable-hooks branch 2 times, most recently from d859219 to c7c2017 Compare October 20, 2025 12:40
Copy link
Member

@iluuu1994 iluuu1994 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@alexandre-daubois alexandre-daubois merged commit 572652e into php:PHP-8.4 Oct 22, 2025
10 checks passed
alexandre-daubois added a commit that referenced this pull request Oct 22, 2025
* PHP-8.4:
  Fix GH-20217: ReflectionClass::isIterable() should return false for classes with property hooks (#20241)
alexandre-daubois added a commit that referenced this pull request Oct 22, 2025
* PHP-8.5:
  Fix GH-20217: ReflectionClass::isIterable() should return false for classes with property hooks (#20241)
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.

Class with property hooks causes ReflectionClass->isIterable() to return true on PHP8.4

3 participants