Skip to content

Fix PDOStatement::getIterator() not throwing when parameters are provided#21331

Closed
alexandre-daubois wants to merge 1 commit intophp:PHP-8.4from
alexandre-daubois:pdo-stmt-get-it
Closed

Fix PDOStatement::getIterator() not throwing when parameters are provided#21331
alexandre-daubois wants to merge 1 commit intophp:PHP-8.4from
alexandre-daubois:pdo-stmt-get-it

Conversation

@alexandre-daubois
Copy link
Member

PDOStatement::getIterator() silently fails if arguments are provided, which is inconsistent with the rest of the file.

@ndossche
Copy link
Member

ndossche commented Mar 3, 2026

No, that macro will call zend_wrong_parameters_none_error so there is no bug here.

@ndossche ndossche closed this Mar 3, 2026
@alexandre-daubois
Copy link
Member Author

Hmmm, then I'm not sure to get why most existing use of this macro are followed by RETURN_THROWS()?

@ndossche
Copy link
Member

ndossche commented Mar 3, 2026

Hmmm, then I'm not sure to get why most existing use of this macro are followed by RETURN_THROWS()?

It's pointless, just convention. The only thing that macro does is assert an exception was thrown and then return.

@alexandre-daubois
Copy link
Member Author

Got it, thanks 👍

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.

2 participants