From: [EMAIL PROTECTED] Operating system: Mandrake 9.0 Linux PHP version: 4.2.3 PHP Bug Type: PCRE related Bug description: Non-termination problems with certain patterns.
This is most likely a bug in the PCRE library. It happens with certain patterns in a no-match situation. Consider the following pattern: /AA(([^A]*A?[^A]+)+)AA/ The letter A doesn't matter. This allows the matching of 'AA' delimited strings, while still allowing single A's inside such strings. Note that /AA(.*)AA/ will not work, since it will just match the outermost enclosing of such a string. Now when matching for instance: test AAthis is a test of some text insideAA end. This works fine, and returns right away with preg_match or preg_replace alike. Also with ereg it works fine (without the / pattern delimiters of course). Now consider the similar string: test AAthis is a test of some text inside end. The delimiter at the end was removed. Now both preg_match and preg_replace time out after the maximum execution time of 30 seconds. ereg still works fine. The longer the text after the opening AA, the longer time it takes. This is long enough to never finish (within the allotted time), while shorter texts will make it finish after e.g. 20 seconds or so. -- Edit bug report at http://bugs.php.net/?id=22023&edit=1 -- Try a CVS snapshot: http://bugs.php.net/fix.php?id=22023&r=trysnapshot Fixed in CVS: http://bugs.php.net/fix.php?id=22023&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=22023&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=22023&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=22023&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=22023&r=support Expected behavior: http://bugs.php.net/fix.php?id=22023&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=22023&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=22023&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=22023&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=22023&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=22023&r=dst IIS Stability: http://bugs.php.net/fix.php?id=22023&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=22023&r=gnused
