[doc-en] master: preg_match(): mention that hitting PCRE limits returns false (#5961)
| From: | qodelicious via GitHub | Date: | Mon, 19 Oct 2026 08:30:40 +0000 |
| Subject: | [doc-en] master: preg_match(): mention that hitting PCRE limits returns false (#5961) | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-23855@lists.php.net to get a copy of this message | ||
Author: qodelicious (qodelicious)
Committer: GitHub (web-flow)
Pusher: lacatoire
Date: 2026-10-19T10:30:36+02:00
Commit: https://github.com/php/doc-en/commit/a7c3d59d21e976ed46d41d22d5cefbee05a9b5d0
Raw diff: https://github.com/php/doc-en/commit/a7c3d59d21e976ed46d41d22d5cefbee05a9b5d0.diff
preg_match(): mention that hitting PCRE limits returns false (#5961)
* preg_match(): mention that hitting PCRE limits returns false
Fixes #4526
* Use simpara for the backtrack limit note
Changed paths:
M reference/pcre/functions/preg-match.xml
Diff:
diff --git a/reference/pcre/functions/preg-match.xml b/reference/pcre/functions/preg-match.xml
index b2b452f4e813..17cc991cfdfe 100644
--- a/reference/pcre/functions/preg-match.xml
+++ b/reference/pcre/functions/preg-match.xml
@@ -276,6 +276,13 @@ Array
<function>preg_match</function> returns 1 if the
<parameter>pattern</parameter>
matches given <parameter>subject</parameter>, 0 if it does
not,&return.falseforfailure;.
</para>
+ <simpara>
+ Matching also fails, and &false; is returned, when the
+ <link linkend="ini.pcre.backtrack-limit">pcre.backtrack_limit</link> or
+ <link linkend="ini.pcre.recursion-limit">pcre.recursion_limit</link> is
reached,
+ which can happen with a long <parameter>subject</parameter>.
+ Use <function>preg_last_error</function> to find out the reason.
+ </simpara>
&return.falseproblem;
</refsect1>