#23053 [Opn->Fbk]: preg_match cause PHP overload the CPU
| From: | sniper@php.net | Date: | Fri, 04 Apr 2003 16:51:19 +0000 |
| Subject: | #23053 [Opn->Fbk]: preg_match cause PHP overload the CPU | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-37142@lists.php.net to get a copy of this message | ||
ID: 23053
Updated by: sniper@php.net
Reported By: php at soundofos dot demon dot nl
-Status: Open
+Status: Feedback
-Bug Type: *Regular Expressions
+Bug Type: PCRE related
Operating System: windows 2000
PHP Version: 4.3.1
New Comment:
Please provide a self-contained example script.
(tested your script with using some random file and it works just
fine)
Previous Comments:
------------------------------------------------------------------------
[2003-04-04 09:09:24] php at soundofos dot demon dot nl
According to the documenmtation,preg_match can handle Arrays
But this will cause PHP to lock up the computer.
$regExp = "/((\/\*)+([\*]*\s*)+(\w+ *)+([\*]\s*(\*+\/{1}))+){1}/";
$file = file($obj->fileLocation);
$sql = preg_replace($regExp,"",$file);
I have tried imploding the array obtained from file() first
but the result was the same.
Maybe i should mention that PHP is running in CGI mode.
regards,
Ed Hofrichter
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=23053&edit=1