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

From: Date: Tue, 22 Dec 2015 04:29:14 +0000
Subject: Bug #71190 [Opn->Csd]: substr_replace converts integers in original $search array to strings
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-198117@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=71190&edit=1 ID: 71190 Updated by: laruence@php.net Reported by: laruence@php.net 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 laruence@gmail.com 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] laruence@php.net 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

« previous php.bugs (#198117) next »