Bug #3864: EREG(i) uses 30-50% cpu
| From: | kevin at nsane dot net | Date: | Sat, 18 Mar 2000 05:17:43 +0000 |
| Subject: | Bug #3864: EREG(i) uses 30-50% cpu | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-16975@lists.php.net to get a copy of this message | ||
From: kevin@nsane.net
Operating system: FreeBSD
PHP version: 3.0.14
PHP Bug Type: Misbehaving function
Bug description: EREG(i) uses 30-50% cpu
<pre>
$exp = "<tr><td><a href=\"(.*)\">(.*)</a></td><td
align=\"center\">(.*)</td><td>(.*)</td><td
align=right><b>(.*)</b></td><td>(.*)</td><td><A
HREF=\"(.*)\">(.*)</A></td></tr>";
$af = fopen("http://cgi3.ebay.com/aw-cgi/eBayISAPI.dll?MfcISAPICommand=ViewListedItems&userid=johannah@ccssinc.com&include=0&since=-1&sort=2&rows=50","r");
while (!$end)
{
$line = fgets($af, 2048);
$content .= $line;
$end = feof($af);
}
fclose($af);
if (ereg($exp,$content,$reg)) {
echo $reg[2] . "\n";
}
</pre>