Re: [PHP-DEV] [RFC] [VOTE] PREG_THROW_ON_ERROR

[email protected] (Osama Aldemeery)
Newsgroups php.internals
Message-ID <CABE7Eu84SzxPVueJ_ZdnNQq3U9dEQ3NiZOz4mn8fQ5LgT9-r4Q@mail.gmail.com>
On Fri, Sep 4, 2026 at 8:00 PM Osama Aldemeery <[email protected]> wrote:
>
> 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

Hi everyone,

I'm cancelling the vote on PREG_THROW_ON_ERROR.

The flag as it stands violates the throwable policy, as Tim's point shows.
That's not something to fix with the vote open, so I'm pulling it back
rather than changing the proposal out from under people who already
voted.

I'll keep the discussion here, and once things settle I'll start a fresh vote.
The RFC is back under discussion.

Thanks to Tim for catching this before it went further.

Regards,
Osama
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.