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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
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-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 16:01:27 2024 UTC