From:             slacouette at edma dot com
Operating system: linux (FC6)
PHP version:      5.2.1
PHP Bug Type:     Strings related
Bug description:  memory corruption

Description:
------------
Repeated calls to str_ireplace appear to cause memory corruption if
replacement is made. In my web application, the resulting string will
"echo" fine but html page generated in subsequent class module is never
served.  str_replace works fine.  Code working fine until upgrade to
5.2.1.

Thanks - great stuff you guys do!

Reproduce code:
---------------
$str_s = str_replace( array('(t)', '(tm)',   '™', chr(153)),      '
(trade marked)',        $str_s );

$str_s = str_replace( array('(r)', '(reg)',  '®',   chr(174)),      '
(registered)',  $str_s );

$str_s = str_replace( array('(c)', '(copy)', '©',  chr(169)),      '
(copyrighted)', $str_s );


Expected result:
----------------
proper substitution and web page served

Actual result:
--------------
guessing memory corruption as html never generated.

-- 
Edit bug report at http://bugs.php.net/?id=40617&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=40617&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=40617&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=40617&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=40617&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=40617&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=40617&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=40617&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=40617&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=40617&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=40617&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=40617&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=40617&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=40617&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=40617&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=40617&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=40617&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=40617&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=40617&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=40617&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=40617&r=mysqlcfg

Reply via email to