Re: [RFC] [VOTE] PREG_THROW_ON_ERROR

From: Date: Sat, 26 Sep 2026 02:26:31 +0000
Subject: Re: [RFC] [VOTE] PREG_THROW_ON_ERROR
References: 1 2 3 4 5 6 7 8  Groups: php.internals 
Request: Send a blank email to internals+get-132646@lists.php.net to get a copy of this message
Hi Tim, > I still believe wrapping is the correct choice, but I won't insist on it > based on policy. Fair enough. I think this is flexible enough to resolve it...especially given that PcreError is not meant to be caught. > Nevertheless the discussion that arised from it pointed > out some other changes that should be made. Yes! > Specifically: > > - Most of the errors (e.g. syntax error in regex) should be PcreError > instead, since they are not meant to be caught. > - preg_last_error() should remain untouched. I agree with both. I will update the RFC and the implementation in the next few days. I am also aware of Gina's Regex\CompiledRegex RFC, and as much as I like the idea, I am not quite sure it fully replaces the PREG_THROW_ON_ERROR flag, although I think it still removes a significant part of the motivation for it. So what I will do is post my comments on the Regex\CompiledRegex thread, and depending on how that discussion develops, I might park this RFC until the other RFC reaches a vote. Otherwise, I will continue with it. Best, Osama

« previous php.internals (#132646) next »