Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:91665 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 76207 invoked from network); 15 Mar 2016 12:51:29 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 15 Mar 2016 12:51:29 -0000 Authentication-Results: pb1.pair.com header.from=php-mailing-list@lool.fr; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=php-mailing-list@lool.fr; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain lool.fr from 212.27.42.2 cause and error) X-PHP-List-Original-Sender: php-mailing-list@lool.fr X-Host-Fingerprint: 212.27.42.2 smtp2-g21.free.fr Received: from [212.27.42.2] ([212.27.42.2:18975] helo=smtp2-g21.free.fr) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 71/00-10575-F4508E65 for ; Tue, 15 Mar 2016 07:51:28 -0500 Received: from pcdepk (unknown [82.236.192.32]) by smtp2-g21.free.fr (Postfix) with ESMTP id DA4F94B01D9; Tue, 15 Mar 2016 13:47:13 +0100 (CET) To: Date: Tue, 15 Mar 2016 13:51:07 +0100 Message-ID: <00ba01d17eb9$57b4eee0$071ecca0$@lool.fr> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_00BB_01D17EC1.B97ADD80" X-Mailer: Microsoft Outlook 16.0 Thread-Index: AdF+uVdrKvT1Yy7ARY2++lNQsZDw7Q== Content-Language: fr Subject: php 7 bug in substr_replace function From: php-mailing-list@lool.fr ("Pascal KISSIAN") ------=_NextPart_000_00BB_01D17EC1.B97ADD80 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Hi everybody, I don't know if this is the right place to report bugs. please let me know for the next time. This is a small snippet that shows the wrong behaviour : When running it under php 7, $line is unchanged and a message is emitted : PHP Warning: substr_replace(): 'from' and 'len' should be of same type - numerical or array in test.php on line 3. $len is not auto-casted in integer.. Btw the message is not very clear as it mentions from and len that are not within the doc. (in my real source code, $len was extracted as string from a database). When $len is an integer, the function works as expected. Tested ok on php 5.3.10 Tested Not ok on php 7.0.3 Best regards, Pascal KISSIAN ------=_NextPart_000_00BB_01D17EC1.B97ADD80--