Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:80840 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 16890 invoked from network); 19 Jan 2015 17:42:27 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Jan 2015 17:42:27 -0000 Authentication-Results: pb1.pair.com smtp.mail=patrick.allaert@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=patrickallaert@php.net; sender-id=unknown Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.212.176 as permitted sender) X-PHP-List-Original-Sender: patrick.allaert@gmail.com X-Host-Fingerprint: 209.85.212.176 mail-wi0-f176.google.com Received: from [209.85.212.176] ([209.85.212.176:47897] helo=mail-wi0-f176.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D0/ED-64889-0024DB45 for ; Mon, 19 Jan 2015 12:42:25 -0500 Received: by mail-wi0-f176.google.com with SMTP id em10so7799389wid.3 for ; Mon, 19 Jan 2015 09:42:21 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=mime-version:references:from:date:message-id:subject:to :content-type; bh=0fzDKxEzvIaQp+n5lT+jUKRdJe1IDPpOGUjYklV4ynA=; b=T3GfngHcrpCHe3NyASP4+MMj8eRB5MS0kjBp/43F+Akgtic2hgkDEsjn43Y8CyaT/h ulq1Hs1W8+j9yY0SDAuSBChsqqMwyIgtE5vKLfKVtjIPO6tLSO4+TrVG8/Zpy6zmVze+ jODTv7in7wcL7ddoaOUmyL7hphmejafRFEk/JWCC2rcdAnMAi9NQMWjDvioVE6LBNw3E +Jpsi8JyqM4NTSRPnfMhW5gGRTeIOmxf2rYm2B0SX13hzQKgrOgFPGdUDy92a0g3ZAy1 y4q4Ceg3p5ftwjNqZN7lCJgqlpK2RQBkeCeHuWpBNjlQ7z4jQI8hf/CWiRhTit0bBFum npRA== X-Received: by 10.180.107.164 with SMTP id hd4mr9859049wib.7.1421689341189; Mon, 19 Jan 2015 09:42:21 -0800 (PST) MIME-Version: 1.0 References: <001f01d02da2$ac2c4a40$0484dec0$@yahoo.fr> Date: Mon, 19 Jan 2015 17:42:20 +0000 Message-ID: To: nf.laupretre@yahoo.fr, internals@lists.php.net Content-Type: multipart/alternative; boundary=e89a8f3ba08529a6d9050d04d803 Subject: Re: [PHP-DEV] [RFC] Improve array to string conversion From: patrickallaert@php.net (Patrick ALLAERT) --e89a8f3ba08529a6d9050d04d803 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Le Sun Jan 11 2015 at 14:30:42, F & N Laupretre a =C3=A9crit : > Hi, > > A new RFC for PHP7 : https://wiki.php.net/rfc/array-to-string > > Not implemented yet, but the PR is available for comments : > https://github.com/php/php-src/pull/991 > > Regards > > Fran=C3=A7ois > Just for the record, when I implemented the E_NOTICE on that conversion I received lot of complaints of users using (incorrectly) the array_diff() family which internally compare all sub-elements given their "string" representation. It means that if you present something for "option 3" you also have to think about the way those functions will behave (and the possible BC introduced. Note the exact same behavior with multi dimensional arrays containing same / different content: // Same sub-array php > var_dump( array_diff( [['a']], [['a']] ) ); PHP Notice: Array to string conversion in php shell code on line 1 array(0) { } // Different sub-array php > var_dump( array_diff( [['a']], [['42']] ) ); PHP Notice: Array to string conversion in php shell code on line 1 array(0) { } My 0.02=E2=82=AC. Patrick --e89a8f3ba08529a6d9050d04d803--