php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #62248 str_replace() with multiple replacing
Submitted: 2012-06-07 05:33 UTC Modified: 2012-06-07 05:54 UTC
Votes:1
Avg. Score:1.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: EternalEssence at yandex dot ru Assigned:
Status: Not a bug Package: Strings related
PHP Version: 5.3.13 OS: Windows 7 / Debian / etc?
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:
MUST BE VALID
Solve the problem:
16 + 2 = ?
Subscribe to this entry?

 
 [2012-06-07 05:33 UTC] EternalEssence at yandex dot ru
Description:
------------
PHP: 5.3, 5.4
Unicode: not


Test script:
---------------
// 1. Works (output "<1>")
die(str_replace(
	array('{a1}', '{b1}', '{c1}', '{d1}'),
	array('a1', '', '1', 'd1'),
	'{b1} <{c1}>'
));

// 2. Error (output nothing)
die(str_replace(
	array('{a1}', '{b1}', '{c1}', '{d1}'),
	array('a1', '', 'c', 'd1'),
	'{b1} <{c1}>'
));

Expected result:
----------------
<c>

Actual result:
--------------
nothing

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-06-07 05:47 UTC] EternalEssence at yandex dot ru
-Status: Open +Status: Closed
 [2012-06-07 05:47 UTC] EternalEssence at yandex dot ru
my mistake
 [2012-06-07 05:54 UTC] rasmus@php.net
-Status: Closed +Status: Not a bug
 [2012-06-07 05:54 UTC] rasmus@php.net
.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 23:01:28 2024 UTC