Hi all,

The discussion period for `PREG_THROW_ON_ERROR` has passed with no open
issues, so I'm opening the vote.

Recap: the RFC adds an opt-in `PREG_THROW_ON_ERROR` flag.
Pass it to any `preg_*` matching function and any PCRE error the call
records is additionally thrown as a `\PregException`, so you can catch it
instead of checking the return value.
The exception's code and message match `preg_last_error()` and
`preg_last_error_msg()` exactly, and a call without the flag behaves
exactly as it does today.

RFC: https://wiki.php.net/rfc/preg_throw_on_error
PR: https://github.com/php/php-src/pull/22797

Voting is open now and closes on 2026-09-18 17:00:00 UTC.

Regards,
Osama

Reply via email to