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
 [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-2020 The PHP Group
All rights reserved.
Last updated: Tue Oct 20 21:01:23 2020 UTC