Bug #1207: str_replace function cause a segmation fault

From: Date: Fri, 05 Mar 1999 17:11:10 +0000
Subject: Bug #1207: str_replace function cause a segmation fault
Groups: php.dev 
Request: Send a blank email to php-dev+get-4485@lists.php.net to get a copy of this message
From: skyhi@vipe.technion.ac.il Operating system: Linux PHP version: 3.0.7 PHP Bug Type: Misbehaving function Bug description: str_replace function cause a segmation fault The following code cause a segmation fault: <?php $lines = 0; $fp = fopen("test.txt", "r"); while ($line = fgets($fp, 128)) { $line = str_replace("with", "without", $line); // $line = ereg_replace("with", "without", $line); $lines += 1; if (($lines % 100) == 0) { echo($lines . " - " . $line . "<BR>\n"); flush(); } } fclose($fp); ?> The "text.txt" file was a file with more than 300 lines: "This is a line with a typo". When I use "str_replace", then the display only reach 200 (seg. fault), but no problem occurs if I use "ereg_replace". -- PHP Development Mailing List http://www.php.net/ To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net For help: php-dev-help@lists.php.net

« previous php.dev (#4485) next »