|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #34145 str_replace() malfunction?
Submitted: 2005-08-16 09:21 UTC Modified: 2005-08-16 09:47 UTC
From: haoyu dot guo at ocef dot org Assigned:
Status: Not a bug Package: Strings related
PHP Version: 4.4.0 OS: Redhat 9
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.
Block user comment
Status: Assign to:
Bug Type:
From: haoyu dot guo at ocef dot org
New email:
PHP Version: OS:


 [2005-08-16 09:21 UTC] haoyu dot guo at ocef dot org
The following code prints nothing while run from web (Apache 2), while it does print "<b" at command line. Could it be a bug or is that something I don't know?


$idg =  "<a";

$idg = str_replace("a", "b", $idg);
print $idg;


Reproduce code:

$idg =  "<a";

$idg = str_replace("a", "b", $idg);
print $idg;


Expected result:
<b (on web)
<b (command line)

Actual result:
nothing (on web)
<a (command line)


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2005-08-16 09:22 UTC] haoyu dot guo at ocef dot org

Actual result:
nothing (on web)
<b (command line)
 [2005-08-16 09:47 UTC]
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at and the instructions on how to report
a bug at

PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 20:01:29 2024 UTC