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

Christian Schneider <[email protected]> Thu, 30 Jul 2026 17:08:33 +0200
Newsgroups gmane.comp.php.devel
Message-ID <[email protected]>
Am 28.07.2026 um 02:56 schrieb Osama Aldemeery <[email protected]>:
> The flag only changes how an error is delivered. A call does exactly =
the same thing with it or without it, byte for byte.
> The only difference is that at the end, any error the call would have =
recorded is additionally thrown, carrying the same code and
> message `preg_last_error()`/`preg_last_error_msg()` would report.

Reading the RFC and specifically the line

> // The detailed "Compilation failed: ..." warning is still emitted, as =
always.

I assume compilation (and other?) failures will then trigger BOTH the =
E_WARNING and an Exception?

This sounds weird to me, do we have a precedent for this behavior?
I would have expected the Exception to replace the E_WARNING.

Regards,
- Chris