Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:83172 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 91168 invoked from network); 19 Feb 2015 12:08:11 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Feb 2015 12:08:11 -0000 Authentication-Results: pb1.pair.com header.from=francois@php.net; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=francois@php.net; spf=unknown; sender-id=unknown Received-SPF: unknown (pb1.pair.com: domain php.net does not designate 212.27.42.2 as permitted sender) X-PHP-List-Original-Sender: francois@php.net X-Host-Fingerprint: 212.27.42.2 smtp2-g21.free.fr Received: from [212.27.42.2] ([212.27.42.2:50175] helo=smtp2-g21.free.fr) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 6E/C0-18870-922D5E45 for ; Thu, 19 Feb 2015 07:08:10 -0500 Received: from moorea (unknown [82.240.16.115]) by smtp2-g21.free.fr (Postfix) with ESMTP id 8D2454B018C; Thu, 19 Feb 2015 13:07:44 +0100 (CET) Reply-To: To: "'Patrick ALLAERT'" , "'Sara Golemon'" Cc: "'PHP internals'" References: <03aa01d04bd3$f8330420$e8990c60$@php.net> In-Reply-To: Date: Thu, 19 Feb 2015 13:08:02 +0100 Message-ID: <043401d04c3c$b648d6c0$22da8440$@php.net> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0435_01D04C45.180E2920" X-Mailer: Microsoft Outlook 14.0 Thread-Index: AQKz6wpj8b81mnwJq1LfxWbU4ZJyQgJsy61hAk54JfYBfn6eewEYZ3KEAplvPdia4URJQA== Content-Language: fr X-Antivirus: avast! (VPS 150219-0, 19/02/2015), Outbound message X-Antivirus-Status: Clean Subject: RE: [PHP-DEV] Scalar Type Hints v0.4 From: francois@php.net (=?utf-8?Q?Fran=C3=A7ois_Laupretre?=) ------=_NextPart_000_0435_01D04C45.180E2920 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Hi Patrick, =20 We already plan a similar mechanism by raising an E_DEPRECATED on = conversions that would have succeded in PHP 5 and will fail using the = proposed new =E2=80=98PHP 7=E2=80=99 ZPP ruleset. =20 Then, it is technically possible to raise a notice on non-strict = conversion but it must be discussed in depth because it can be very = confusing, as E_NOTICE or, even, E_STRICT, are typically associated with = =E2=80=98bad practice=E2=80=99, and that=E2=80=99s not the case here. = So, a lot of people would assume these as something = =E2=80=98clean=E2=80=99 code should avoid. Maybe another error type = could be needed, but I don=E2=80=99t see the need as so important. =20 Regards =20 Fran=C3=A7ois =20 De : Patrick ALLAERT [mailto:patrickallaert@php.net]=20 Envoy=C3=A9 : jeudi 19 f=C3=A9vrier 2015 11:07 =C3=80 : francois@php.net; Sara Golemon Cc : PHP internals Objet : Re: [PHP-DEV] Scalar Type Hints v0.4 =20 Le Thu Feb 19 2015 at 00:38:25, Fran=C3=A7ois Laupretre = a =C3=A9crit : > Why can't strictness follow that path? Because strictness is not the overall objective the PHP language is = aiming to. =20 I cannot agree more with that. =20 If it was the case, your mechanism would be fine, but deprecating ZPP = conversion would be simpler and fine too. =20 I'm not so sure about the "simpler". =20 This is definitely not the same case as generating a notice on array to = string. =20 Sure, I just wanted to pinpoint that "because strictness is not the = overall objective of the PHP language", we may consider a weak approach = accompanied by an activable (configurable?) mechanism that would notices = us of bad types, bad coercion, conversion with loss,... =20 That's what I hate in this 'weak' vs 'strict' terminology. It makes = implicit that 'strict' is the natural future and improvement of 'weak'. = That's absolutely not the case as 'weak' mode is not as negative as name = suggests, and 'strict' is not so positive either. So, you may stop = considering that the natural path for 'weak'-typed software is to = migrate to strict types. =20 I never implied something like this, quite the opposite since I feel I = am completely aligned with you!=20 =20 When we decide encouraging migrating to strict mode with a deprecation = on ZPP conversion, I hope I'll be far away... =20 +1 =20 > PS: your feedback makes me feel it would be; even more; a viable = option :) Fine. But may I remind you the so-called great benefit you underlined in = your post is totally wrong and shows total ignorance of the difference = between casting and ZPP conversion rules which, IMO, is a fundamental = pre-requisite before laughing at people working on this. =20 I never laughed at any one here. Sorry if someone felt that way by the = simple use of a smiley. ------=_NextPart_000_0435_01D04C45.180E2920--