Bug #1210: str_replace does not work when needle at end of haystack

From: Date: Sun, 07 Mar 1999 20:15:46 +0000
Subject: Bug #1210: str_replace does not work when needle at end of haystack
Groups: php.dev 
Request: Send a blank email to php-dev+get-4514@lists.php.net to get a copy of this message
From: venaas@itea.ntnu.no Operating system: linux and solaris PHP version: 3.0.7 PHP Bug Type: Misbehaving function Bug description: str_replace does not work when needle at end of haystack The following script outputs 12a12 as expected with 3.0.6 on Linux using the regexp library bundled with PHP. Using the exact same configuration with 3.0.7 produces 12a34. Here is the script: <?php echo str_replace("34", "12", "34a"); echo str_replace("34", "12", "34"); ?> It also fails with 3.0.7 on Solaris with a very different configuration. Stig -- 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 (#4514) next »