Re: [RFC] [VOTE] PREG_THROW_ON_ERROR
| From: | Osama Aldemeery | Date: | Mon, 07 Sep 2026 00:35:01 +0000 |
| Subject: | Re: [RFC] [VOTE] PREG_THROW_ON_ERROR | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-132438@lists.php.net to get a copy of this message | ||
On Fri, Sep 4, 2026 at 8:00 PM Osama Aldemeery <aldemeery@gmail.com> 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