Skip to content

[RFC] FILTER_THROW_ON_FAILURE - #18896

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

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

Conversation

@DanielEScherzer

@DanielEScherzerDanielEScherzer commented Jun 21, 2025

Copy link
Copy Markdown
Member

@DanielEScherzerDanielEScherzer linked an issue Jun 21, 2025 that may be closed by this pull request
@DanielEScherzerDanielEScherzer changed the title [RFC} FILTER_THROW_ON_FAILURE[RFC] FILTER_THROW_ON_FAILUREJun 21, 2025
@DanielEScherzer
DanielEScherzer marked this pull request as draft June 22, 2025 00:21
@DanielEScherzer
DanielEScherzerforce-pushed the filter-throw-on-failure branch from 8c5abca to 86969e5CompareJune 22, 2025 05:52
Comment threadext/filter/filter.c Outdated
Comment threadext/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 threadext/filter/filter.c Outdated
Comment threadext/filter/filter.c Outdated
@DanielEScherzer

Copy link
Copy Markdown
MemberAuthor

Rebased for conflict from #19073

@DanielEScherzer
DanielEScherzer marked this pull request as ready for review August 20, 2025 09:09

@iluuu1994iluuu1994 left a comment

Copy link
Copy Markdown
Member

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 threadext/filter/tests/throw-on-failure/filter_var_array_failure.phpt Outdated
Comment threadext/filter/filter.c Outdated
Comment threadext/filter/filter_private.h Outdated
@DanielEScherzer

Copy link
Copy Markdown
MemberAuthor

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

Done

@DanielEScherzer
DanielEScherzer merged commit 0b326dc into php:masterAug 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 freeto 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

@DanielEScherzer@divinity76@derickr@iluuu1994