#39059 [Fbk->Opn]: str_replace: fourth parameter is always zero
ID: 39059
User updated by: third-chance at gmx dot de
Reported By: third-chance at gmx dot de
-Status: Feedback
+Status: Open
Bug Type: Strings related
Operating System: Windows XP SP2
PHP Version: 5CVS-2006-10-06 (snap)
New Comment:
I do not have any old version of php5ts.dll anywhere. Just the current
on in the php-directory.
Previous Comments:
------------------------------------------------------------------------
[2006-10-06 12:44:35] tony2001@php.net
Please make sure you deleted php5ts.dll from 5.1.6 and put the one from
the snapshot instead.
I cannot reproduce it with the snapshot.
------------------------------------------------------------------------
[2006-10-06 12:32:39] third-chance at gmx dot de
I have tried it with the version from your link.
The problem persists and is still the same.
------------------------------------------------------------------------
[2006-10-06 11:04:38] tony2001@php.net
Please try using this CVS snapshot:
http://snaps.php.net/php5.2-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php5.2-win32-latest.zip
------------------------------------------------------------------------
[2006-10-06 10:46:38] third-chance at gmx dot de
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 this bug report at http://bugs.php.net/?id=39059&edit=1
Thread (10 messages)