|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #27216 parsing crashes on texts longer than 3799 chars
Submitted: 2004-02-10 21:03 UTC Modified: 2004-02-11 05:13 UTC
From: list at fredfred dot net Assigned:
Status: Not a bug Package: PCRE related
PHP Version: 4.3.4 OS: Linux,Windows XP
Private report: No CVE-ID: None
 [2004-02-10 21:03 UTC] list at fredfred dot net
When I try use preg_match_all( $regexp, $a, $vysl);
it crashes when $a contains text in format like in file here:
Basically it contains 'abbba(3799 times char s or \r\n)xa'
 Just delete the last 'x' and it works fine.

Reproduce code:
$a = I read content of file

$regexp = "/a(.*)a((?:.|\n)*?)a/i";

if(preg_match_all( $regexp, $a, $vysl))
  echo "found";
  echo "not found";

Expected result:
"found" or "not found"

Actual result:
CGI Error
The specified CGI application misbehaved by not returning a complete set of HTTP headers. The headers it did return are:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2004-02-11 05:13 UTC]
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at and the instructions on how to report
a bug at

You should also have searched the bug database for previous reports about this same issue. (there are dozens of them!)

This is PCRE limit you're hitting, not PHP bug.

PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Sat Jan 29 02:03:33 2022 UTC