Bug #71190 [Opn->Csd]: substr_replace converts integers in original $search array to strings

[email protected]
Newsgroups php.bugs
Message-ID <[email protected]>
Edit report at https://bugs.php.net/bug.php?id=71190&edit=1

 ID:                 71190
 Updated by:         [email protected]
 Reported by:        [email protected]
 Summary:            substr_replace converts integers in original $search
                     array to strings
-Status:             Open
+Status:             Closed
 Type:               Bug
 Package:            *General Issues
 PHP Version:        7.0.1
 Block user comment: N
 Private report:     N

 New Comment:

Automatic comment on behalf of [email protected]
Revision: http://git.php.net/?p=php-src.git;a=commit;h=d63ae2c3822f43567aa5e40f3067183001900c39
Log: Fixed bug #71190 (substr_replace converts integers in original $search array to strings)


Previous Comments:
------------------------------------------------------------------------
[2015-12-22 04:03:57] [email protected]

Description:
------------
none

Test script:
---------------
<?php
$b = [0, 1, 2];

var_dump($b);
substr_replace("test", $b, "1");
var_dump($b);

Expected result:
----------------
array(3) {
  [0]=>
  int(0)
  [1]=>
  int(1)
  [2]=>
  int(2)
}
array(3) {
  [0]=>
  int(0)
  [1]=>
  int(1)
  [2]=>
  int(2)
}

Actual result:
--------------
array(3) {
  [0]=>
  int(0)
  [1]=>
  int(1)
  [2]=>
  int(2)
}
array(3) {
  [0]=>
  string(1) "0"
  [1]=>
  int(1)
  [2]=>
  int(2)
}
[Tue Dec 22 12:03:13 2015]  Script:  '/tmp/1.php'
/home/huixinchen/opensource/php-7.0/Zend/zend_string.h(121) :  Freeing 0x7FFFF8059D00 (32 bytes), script=/tmp/1.php
=== Total 1 memory leaks detected ===


------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=71190&edit=1
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.