Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:84165 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 2295 invoked from network); 2 Mar 2015 12:39:35 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 2 Mar 2015 12:39:35 -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 74.125.82.176 as permitted sender) X-PHP-List-Original-Sender: patrick.allaert@gmail.com X-Host-Fingerprint: 74.125.82.176 mail-we0-f176.google.com Received: from [74.125.82.176] ([74.125.82.176:39890] helo=mail-we0-f176.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 85/66-48321-50A54F45 for ; Mon, 02 Mar 2015 07:39:33 -0500 Received: by wesx3 with SMTP id x3so33012951wes.6 for ; Mon, 02 Mar 2015 04:39:30 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=mime-version:from:date:message-id:subject:to:cc:content-type; bh=5me4mTdqtScnxFHPkvn2dvcBRgpMAQ7X8H8dowzi2YA=; b=OG6bGpIvJSJ4SZokIDNCqjowEdpmeqoO5G9hUSBBJGFAV3/MXQW1i6rJGkmVPzPMh8 bZ+S02ppiM5oG0kRAkQ3eTYttgxEQ/wJVdlRaOCbj6tOyX1ftUmJNWPK3GOs4gWhl9kM 7PYn7a9M1kDv8VjY5XnsocafO9zmXINlWBuki8bbSql/usPzcrSktnHNUNHq+SEcrDS0 RYNykXnlg0NoflmmnSHvVeOXEHaKHNzO/K3FdtZBdbuavAVnHbZZ3M06L3iOG+YHQh5m P1p7xmsCuN94RH2Eg5d1gQvz8wqSM8IrTa0bTs8C4wwoTDzgD+R6dh+Dzg/CMayJJIPW qJrA== X-Received: by 10.180.211.206 with SMTP id ne14mr34735663wic.79.1425299969882; Mon, 02 Mar 2015 04:39:29 -0800 (PST) MIME-Version: 1.0 Date: Mon, 02 Mar 2015 12:39:28 +0000 Message-ID: To: Xinchen Hui , francois@php.net Cc: PHP Internals Content-Type: multipart/alternative; boundary=001a11c37d4467432e05104d8212 Subject: Re: [PHP-DEV] [RFC][VOTE] Improve array to string conversion From: patrickallaert@php.net (Patrick ALLAERT) --001a11c37d4467432e05104d8212 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Le mer. 25 f=C3=A9vr. 2015 =C3=A0 12:16, Xinchen Hui a = =C3=A9crit : Hey: > > On Tue, Feb 24, 2015 at 12:06 AM, Fran=C3=A7ois Laupretre > wrote: > > Hi, > > > > Starting the vote for https://wiki.php.net/rfc/array-to-string. > > > > Please note that, while the initial RFC proposed both options of either > > fully supporting the feature, or disabling it, the voting choices are > now : > > > > - either definitely disabling array to string conversion, > > - or keep current behavior as-is. > > > > Vote ends March 6, 00:00 (UTC). > replace E_NOTICE with E_RECOVERABLE_ERROR?? > > it's a huge BC break..... > > I vote -1 on this. > > thanks > > > > Regards > > > > Fran=C3=A7ois > > > > > > -- > > PHP Internals - PHP Runtime Development Mailing List > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > -- > Xinchen Hui > @Laruence > http://www.laruence.com/ > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php Hello, I'm explaining here the reasons of my "-1" vote. 1) You suggest (in your PR) changing the conversion in _convert_to_string() but not in zend_make_printable_zval(). That makes it completely inconsistent. 2) It breaks code "that works": if (!is_string($myArgument)) { $logger->log("Invalid argument passed: " $myArgument) } Yes, var_export() could have been used, but it breaks something that "worked" before and this is therefore an important BC break. 3) I am wondering what it really *brings* to devs by changing E_NOTICE to E_RECOVERABLE_ERROR. Those that want to know when this is happening can already with E_NOTICE in their error_reporting. Those that do not actually care might probably not care more. I'm worried that those will *fix* issues like this: $diff =3D array_diff($multiDimensionalArray1, $multiDimensionalArray2); with: $diff =3D @array_diff($multiDimensionalArray1, $multiDimensionalArray2)= ; I'm not fundamentally against the idea to break the execution when this is happening, but I'd rather *opt in* for it, especially if: $weird =3D (string) $anArray; would generate an error because of a conversion with loss, while: $oops =3D (float) "one hundred"; would simply not break *and* do not provide even a notice! I'd rather introduce an E_CONVERSION_LOSS which would be triggered in all case of conversion loss than just targeting the specific "array -> string" case. Thanks, Patrick --001a11c37d4467432e05104d8212--