|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #40617 problem refinement
Submitted: 2007-02-24 01:55 UTC Modified: 2007-02-24 03:35 UTC
From: nevermind at address dot org Assigned:
Status: Closed Package: Strings related
PHP Version: 5.2.1 OS: linux (FC6)
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
41 - 18 = ?
Subscribe to this entry?

 [2007-02-24 01:55 UTC] nevermind at address dot org
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.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2007-02-24 02:05 UTC] nevermind at address dot org
Likely this is too obscure to find with what I've provided.
 [2007-02-24 03:35 UTC] nevermind at address dot org
non-alphabetic "search" argument for str_ireplace causes memory corruption.
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Wed Oct 04 08:01:25 2023 UTC