php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #9325 wrong parameter count for preg_replace
Submitted: 2001-02-18 13:14 UTC Modified: 2001-02-22 10:46 UTC
From: tm at salome dot datron dot cz Assigned:
Status: Not a bug Package: *Regular Expressions
PHP Version: 4.0.4pl1 OS: linux
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: tm at salome dot datron dot cz
New email:
PHP Version: OS:

 

 [2001-02-18 13:14 UTC] tm at salome dot datron dot cz
i've the following code:
<?
  $string="test test test test"
  $newstring=preg_replace("/test/","ok",$newstring,1);
  echo $newstring;
?>
from your manual pages to preg_replace function it allow to specify a limit number of matches. But here it reports an error:  Wrong parameter count for preg_replace() in test.php on line 3

;-(

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-02-22 10:46 UTC] stas@php.net
works for me in latest version. You probably have an old
one. BTW, you have bug in your code - preg_replace shoudl
take string, not newstring.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 26 12:01:30 2024 UTC