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 Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: EternalEssence at yandex dot ru
New email:
PHP Version: OS:

 

 [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

Pull Requests

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: Sun Dec 22 06:01:30 2024 UTC