ID: 24784 Updated by: [EMAIL PROTECTED] Reported By: philip at cornado dot com Status: Open Bug Type: Strings related Operating System: linux PHP Version: 5CVS-2003-07-23 (dev) New Comment:
Actual result is 0. The bug database didn't allow 0 as an actual or expected result value, but does now :) Previous Comments: ------------------------------------------------------------------------ [2003-07-23 21:14:27] philip at cornado dot com Description: ------------ str_[i]replace() has a count parameter that returns a variable (by reference) with a count of replacements. This is not counting when the search string is one character in length. Reproduce code: --------------- <?php $count = 0; $str = str_replace('a', '', 'apples are good', $count); echo $count; ?> Expected result: ---------------- 2 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=24784&edit=1