php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #50835 Unexpected PREG_BACKTRACK_LIMIT_ERROR
Submitted: 2010-01-25 15:54 UTC Modified: 2010-01-25 15:58 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: analogue at glop dot org Assigned:
Status: Not a bug Package: PCRE related
PHP Version: 5.2.12 OS: Debian GNU/Linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: analogue at glop dot org
New email:
PHP Version: OS:

 

 [2010-01-25 15:54 UTC] analogue at glop dot org
Description:
------------
Hi,

When I try to preg_replace a 2654 long string, I get a PREG_BACKTRACK_LIMIT_ERROR

It's strange because as shown, the PHP pcre.backtrack_limit is set as the default 100000 limit.

Why does it hits the limit with a short string like this ?

Thanks

Reproduce code:
---------------
<http://pastebin.com/fa42d78d>

Expected result:
----------------
100000
2653
2653


Actual result:
--------------
100000
2653
Error: PREG_BACKTRACK_LIMIT_ERROR


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-01-25 15:58 UTC] jani@php.net
Ask PCRE developers.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Jul 03 10:01:33 2025 UTC