#34145 [NEW]: str_replace() malfunction?
| From: | haoyu dot guo at ocef dot org | Date: | Tue, 16 Aug 2005 07:21:38 +0000 |
| Subject: | #34145 [NEW]: str_replace() malfunction? | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-83626@lists.php.net to get a copy of this message | ||
From: haoyu dot guo at ocef dot org
Operating system: Redhat 9
PHP version: 4.4.0
PHP Bug Type: Strings related
Bug description: str_replace() malfunction?
Description:
------------
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?
<?php
$idg = "<a";
$idg = str_replace("a", "b", $idg);
print $idg;
?>
Reproduce code:
---------------
<?php
$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)
--
Edit bug report at http://bugs.php.net/?id=34145&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=34145&r=trysnapshot4
Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=34145&r=trysnapshot50
Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=34145&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=34145&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=34145&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=34145&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=34145&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=34145&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=34145&r=support
Expected behavior: http://bugs.php.net/fix.php?id=34145&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=34145&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=34145&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=34145&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=34145&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=34145&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=34145&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=34145&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=34145&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=34145&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=34145&r=mysqlcfg