Re: [PRE-RFC] PREG_THROW_ON_ERROR flag

From: Date: Fri, 10 Jul 2026 02:41:12 +0000
Subject: Re: [PRE-RFC] PREG_THROW_ON_ERROR flag
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-131846@lists.php.net to get a copy of this message
Hi Tim, > Pcre\PcreException would technically be fully in line with the naming > and Throwable policy, by including the extension name as the prefix. > However the existing PCRE functions use preg_ as a prefix, it > will > probably be confusing to have the two different prefixes here. Given > that, I would suggest going with an unnamespaced \PregException for now > and then only introduce a namespace when actually building a new API to > not paint us into a corner already. > > The naming policy specifically allows for that: > > > When adding new symbols to existing extensions it is RECOMMENDED to be > > consistent with existing symbols, rather than to follow the namespacing > > guidelines. > > and > > > Newly introduced extensions MUST follow the following rules, existing > > extensions SHOULD follow the rules for newly introduced exceptions, but > > MAY diverge for consistency with existing symbols. I'd missed that entirely...thanks for the pointer! And I think your reasoning about \PregException makes sense, I'll switch to that. Thanks, Osama

« previous php.internals (#131846) next »