php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #24269 str_replace doesn't accept forth param in 4.3.2.
Submitted: 2003-06-20 11:28 UTC Modified: 2003-06-20 12:39 UTC
From: bking at starbridgesystems dot com Assigned:
Status: Not a bug Package: Documentation problem
PHP Version: 4.3.2 OS: WinXP
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: bking at starbridgesystems dot com
New email:
PHP Version: OS:

 

 [2003-06-20 11:28 UTC] bking at starbridgesystems dot com
Description:
------------
The str_replace funtion doesn't accept the forth parameter in 4.3.2. The documentation says it will accept four parameters. We need to fix one or the other.

Reproduce code:
---------------
C:\PHP432>php -q
<? echo str_replace("dumb","dumber","dumb dumb dumb",$count); ?>
^Z
<br />
<b>Notice</b>:  Undefined variable:  count in <b>C:\PHP432\-</b> on line <b>1</b
><br />
<br />
<b>Warning</b>:  Wrong parameter count for str_replace() in <b>C:\PHP432\-</b> o
n line <b>1</b><br />


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-06-20 11:32 UTC] philip@php.net
Currently from the manual:

Note:  As of PHP 5.0 the number of matched and replaced needles will be returned in count which is passed by reference. 

This eludes to the fact that the parameter exists since PHP 5.0.0 but can be made clearer.  Reclassified->docbug.
 [2003-06-20 12:39 UTC] pollita@php.net
That's because the fourth parameter isn't available until PHP 5.0.

Direct from the manual:
---------------------------------------
Note: As of PHP 5.0 the number of matched and replaced needles will be returned in count which is passed by reference. 
---------------------------------------

 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Tue Oct 19 08:03:37 2021 UTC