From: third-chance at gmx dot de Operating system: Windows XP SP2 PHP version: 5CVS-2006-10-06 (snap) PHP Bug Type: *General Issues Bug description: str_replace: fourth parameter is always zero
Description: ------------ Hello, first: i am using the latest Win32-binary currently available from snaps.php.net (php5.2-win32-200610051830) with an Apache 2.2 (sapi). When calling the function str_replace the fourth parameter - which should be set to the number of replacements - is always set to zero. With Php5.1.1 and an Apache 2.0.55 it works as expected. Best regards, Dirk Reproduce code: --------------- $c = 23; echo str_replace('i', 'o', 'string', $c); echo ' '.$c; Expected result: ---------------- strong 1 Actual result: -------------- strong 0 Even one string replacement took place ('i' => 'o'), the referenced value for counting is set to zero. -- Edit bug report at http://bugs.php.net/?id=39059&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=39059&r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=39059&r=trysnapshot52 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=39059&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=39059&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=39059&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=39059&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=39059&r=needscript Try newer version: http://bugs.php.net/fix.php?id=39059&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=39059&r=support Expected behavior: http://bugs.php.net/fix.php?id=39059&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=39059&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=39059&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=39059&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=39059&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=39059&r=dst IIS Stability: http://bugs.php.net/fix.php?id=39059&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=39059&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=39059&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=39059&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=39059&r=mysqlcfg