Skip to content

[RFC] FILTER_THROW_ON_FAILURE#18896

Merged
DanielEScherzer merged 3 commits intophp:masterfrom
DanielEScherzer:filter-throw-on-failure
Aug 26, 2025
Merged

[RFC] FILTER_THROW_ON_FAILURE#18896
DanielEScherzer merged 3 commits intophp:masterfrom
DanielEScherzer:filter-throw-on-failure

Conversation

@DanielEScherzer
Copy link
Copy Markdown
Member

@DanielEScherzer DanielEScherzer commented Jun 21, 2025

@DanielEScherzer DanielEScherzer linked an issue Jun 21, 2025 that may be closed by this pull request
@DanielEScherzer DanielEScherzer changed the title [RFC} FILTER_THROW_ON_FAILURE [RFC] FILTER_THROW_ON_FAILURE Jun 21, 2025
@DanielEScherzer DanielEScherzer marked this pull request as draft June 22, 2025 00:21
@DanielEScherzer DanielEScherzer force-pushed the filter-throw-on-failure branch from 8c5abca to 86969e5 Compare June 22, 2025 05:52
Comment thread ext/filter/filter.c Outdated
Comment thread ext/filter/filter_private.h Outdated
@divinity76
Copy link
Copy Markdown
Contributor

LGTM fwiw. (I don't have access use the actual github review form on php-src, but it lgtm.)

Comment thread ext/filter/filter.c Outdated
Comment thread ext/filter/filter.c Outdated
@DanielEScherzer
Copy link
Copy Markdown
Member Author

Rebased for conflict from #19073

@DanielEScherzer DanielEScherzer marked this pull request as ready for review August 20, 2025 09:09
Copy link
Copy Markdown
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.

Seems like we should have at least a simple successful test using FILTER_THROW_ON_FAILURE.

Comment thread ext/filter/tests/throw-on-failure/filter_var_array_failure.phpt Outdated
Comment thread ext/filter/filter.c Outdated
Comment thread ext/filter/filter_private.h Outdated
@DanielEScherzer
Copy link
Copy Markdown
Member Author

Seems like we should have at least a simple successful test using FILTER_THROW_ON_FAILURE.

Done

@DanielEScherzer DanielEScherzer force-pushed the filter-throw-on-failure branch from a84affd to 0c5d337 Compare August 26, 2025 09:37
@DanielEScherzer DanielEScherzer merged commit 0b326dc into php:master Aug 26, 2025
9 checks passed
@DanielEScherzer DanielEScherzer deleted the filter-throw-on-failure branch August 26, 2025 10:16
Ayesh added a commit to Ayesh/polyfill that referenced this pull request Nov 19, 2025
…xception`

PHP 8.5 adds two new exception classes, along with the new
`FILTER_THROW_ON_FAILURE` flag. We can not polyfill the exception
behavior (which is activated with the `FILTER_THROW_ON_FAILURE` flag),
but we can still polyfill the exception classes.

 - [RFC](https://wiki.php.net/rfc/filter_throw_on_failure)
 - [PR](php/php-src#18896)
 - [`Filter\FilterException`](https://php.watch/versions/8.5/filter-validation-throw-exception#FilterException), [codex](https://php.watch/codex/Filter/FilterException)
 - [`Filter\FilterFailedException`](https://php.watch/versions/8.5/filter-validation-throw-exception#FilterFailedException), [codex](https://php.watch/codex/Filter/FilterFailedException)
Ayesh added a commit to Ayesh/polyfill that referenced this pull request Nov 19, 2025
…xception`

PHP 8.5 adds two new exception classes, along with the new
`FILTER_THROW_ON_FAILURE` flag. We can not polyfill the exception
behavior (which is activated with the `FILTER_THROW_ON_FAILURE` flag),
but we can still polyfill the exception classes.

 - [RFC](https://wiki.php.net/rfc/filter_throw_on_failure)
 - [PR](php/php-src#18896)
 - [`Filter\FilterException`](https://php.watch/versions/8.5/filter-validation-throw-exception#FilterException), [codex](https://php.watch/codex/Filter/FilterException)
 - [`Filter\FilterFailedException`](https://php.watch/versions/8.5/filter-validation-throw-exception#FilterFailedException), [codex](https://php.watch/codex/Filter/FilterFailedException)
Ayesh added a commit to Ayesh/polyfill that referenced this pull request Apr 6, 2026
…xception`

PHP 8.5 adds two new exception classes, along with the new
`FILTER_THROW_ON_FAILURE` flag. We can not polyfill the exception
behavior (which is activated with the `FILTER_THROW_ON_FAILURE` flag),
but we can still polyfill the exception classes.

 - [RFC](https://wiki.php.net/rfc/filter_throw_on_failure)
 - [PR](php/php-src#18896)
 - [`Filter\FilterException`](https://php.watch/versions/8.5/filter-validation-throw-exception#FilterException), [codex](https://php.watch/codex/Filter/FilterException)
 - [`Filter\FilterFailedException`](https://php.watch/versions/8.5/filter-validation-throw-exception#FilterFailedException), [codex](https://php.watch/codex/Filter/FilterFailedException)
nicolas-grekas pushed a commit to Ayesh/polyfill that referenced this pull request Apr 10, 2026
…xception`

PHP 8.5 adds two new exception classes, along with the new
`FILTER_THROW_ON_FAILURE` flag. We can not polyfill the exception
behavior (which is activated with the `FILTER_THROW_ON_FAILURE` flag),
but we can still polyfill the exception classes.

 - [RFC](https://wiki.php.net/rfc/filter_throw_on_failure)
 - [PR](php/php-src#18896)
 - [`Filter\FilterException`](https://php.watch/versions/8.5/filter-validation-throw-exception#FilterException), [codex](https://php.watch/codex/Filter/FilterException)
 - [`Filter\FilterFailedException`](https://php.watch/versions/8.5/filter-validation-throw-exception#FilterFailedException), [codex](https://php.watch/codex/Filter/FilterFailedException)
nicolas-grekas added a commit to symfony/polyfill that referenced this pull request Apr 10, 2026
…FilterFailedException` (Ayesh)

This PR was merged into the 1.x branch.

Discussion
----------

[PHP 8.5] Add new `\Filter\FilterException` and `Filter\FilterFailedException`

PHP 8.5 adds two new exception classes, along with the new `FILTER_THROW_ON_FAILURE` flag. We can not polyfill the exception behavior (which is activated with the `FILTER_THROW_ON_FAILURE` flag), but we can still polyfill the exception classes.

 - [RFC](https://wiki.php.net/rfc/filter_throw_on_failure)
 - [PR](php/php-src#18896)
 - [`Filter\FilterException`](https://php.watch/versions/8.5/filter-validation-throw-exception#FilterException), [codex](https://php.watch/codex/Filter/FilterException)
 - [`Filter\FilterFailedException`](https://php.watch/versions/8.5/filter-validation-throw-exception#FilterFailedException), [codex](https://php.watch/codex/Filter/FilterFailedException)

Commits
-------

52a0cc6 [PHP 8.5] Add new `\Filter\FilterException` and `Filter\FilterFailedException`
symfony-splitter pushed a commit to symfony/polyfill-php85 that referenced this pull request Apr 10, 2026
…xception`

PHP 8.5 adds two new exception classes, along with the new
`FILTER_THROW_ON_FAILURE` flag. We can not polyfill the exception
behavior (which is activated with the `FILTER_THROW_ON_FAILURE` flag),
but we can still polyfill the exception classes.

 - [RFC](https://wiki.php.net/rfc/filter_throw_on_failure)
 - [PR](php/php-src#18896)
 - [`Filter\FilterException`](https://php.watch/versions/8.5/filter-validation-throw-exception#FilterException), [codex](https://php.watch/codex/Filter/FilterException)
 - [`Filter\FilterFailedException`](https://php.watch/versions/8.5/filter-validation-throw-exception#FilterFailedException), [codex](https://php.watch/codex/Filter/FilterFailedException)
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.

FILTER_THROW_ON_FAILURE flag?

4 participants