Is 100.000 times match() enough for you?

By crisp on Sunday 18 March 2007 02:49 - Comments are closed
Category: PHP, Views: 3.463

PHP 5.2 now comes with 2 new .ini directives:

code:
1
2
3
[Pcre]
;pcre.recursion_limit=100000
;pcre.backtrack_limit=100000



Although default disabled PHP will still force these defaults onto PCRE which will cause failure on common regular expressions fed on content that has more than 100.000 bytes.

Actually these settings map to PCRE's MATCH_LIMIT and MATCH_LIMIT_RECURSION directives, none of which have actually anything to do with backtracking in particular and which within PCRE are set to 10.000.000 by default...

update 23/12/2007: http://bugs.php.net/bug.php?id=40846 is the filed bugreport and this problem is still current.