You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This has some overlap with pattern matching, more specifically the as keyword. It's not a full alternative, given that pattern matching doesn't support e-mails, URLs, etc.
Makes sense, but we need to consider the behavior of filter_var_array().
I'd say that any time FILTER_NULL_ON_FAILURE would trigger returning null, we would throw, to be consistent
This probably needs an RFC the same way that https://wiki.php.net/rfc/json_throw_on_error did, I'll add this to my list but I already have two RFCs under discussion at the moment
Activity
cmb69 commentedon Nov 6, 2024
Makes sense, but we need to consider the behavior of
filter_var_array().iluuu1994 commentedon Nov 6, 2024
This has some overlap with pattern matching, more specifically the
askeyword. It's not a full alternative, given that pattern matching doesn't support e-mails, URLs, etc.DanielEScherzer commentedon Mar 25, 2025
I'd say that any time FILTER_NULL_ON_FAILURE would trigger returning null, we would throw, to be consistent
This probably needs an RFC the same way that https://wiki.php.net/rfc/json_throw_on_error did, I'll add this to my list but I already have two RFCs under discussion at the moment
DanielEScherzer commentedon Jun 21, 2025
@divinity76 I've created a PR for this, can you help provide an example use case that I can put in the RFC?