Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:83591 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 2974 invoked from network); 23 Feb 2015 17:20:23 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 Feb 2015 17:20:23 -0000 Authentication-Results: pb1.pair.com smtp.mail=kontakt@beberlei.de; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=kontakt@beberlei.de; sender-id=unknown Received-SPF: error (pb1.pair.com: domain beberlei.de from 209.85.212.169 cause and error) X-PHP-List-Original-Sender: kontakt@beberlei.de X-Host-Fingerprint: 209.85.212.169 mail-wi0-f169.google.com Received: from [209.85.212.169] ([209.85.212.169:45290] helo=mail-wi0-f169.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 97/08-01128-4516BE45 for ; Mon, 23 Feb 2015 12:20:23 -0500 Received: by mail-wi0-f169.google.com with SMTP id em10so21712877wid.0 for ; Mon, 23 Feb 2015 09:20:17 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=Fv+vSJ7P3VDK2gybCXS2MpED5R5NDfal7p4g2/PvpMY=; b=dT92ayc71zRj6o0Ul1/Fk1DTOy0qGkRUhuGCmj9YjvrWHLh9L+//rPFeChcXa7dN8v COByQ5FMylZQ18z2G9MaraUHm+a3Sl5Iks3hl1cSbekmDaPnr56Om4BCn49X7cqnT3fP 1Rf2Ya06EAAOFfHrKWhsnGjYOoEaqf7tcs0xbm+k7v2p7H0vBK2YLvBbNhCtcBPs0LGM 0VcPOEw+48TPueT4BtcLtZ3cox9uchT6znGOc29FbF30wuqHpwCAG5TvgfueadzXbhlP S19EilIiIcYVynpIEK9txOxIJrYzLbDDdpaUyPQy2POaqz0ROOrdm3+nF3vU4DSc9vjR 4Cyw== X-Gm-Message-State: ALoCoQkhdBtsxS1pJXYQke31pdLe+i18Cfg97dwiAaiuyrxHNnc094FtsGzWBCzGCZg5IIFGnDzq MIME-Version: 1.0 X-Received: by 10.194.185.68 with SMTP id fa4mr23655392wjc.111.1424712017606; Mon, 23 Feb 2015 09:20:17 -0800 (PST) Received: by 10.194.192.202 with HTTP; Mon, 23 Feb 2015 09:20:17 -0800 (PST) X-Originating-IP: [217.246.102.4] In-Reply-To: References: <7ef509ef10bb345c792f9d259c7a3fbb@mail.gmail.com> <9aec85c81b49009c6238ff6d8be27cd4@mail.gmail.com> Date: Mon, 23 Feb 2015 18:20:17 +0100 Message-ID: To: Zeev Suraski Cc: PHP internals Content-Type: multipart/alternative; boundary=047d7bacb11eb78dc2050fc49dbd Subject: Re: [PHP-DEV] Coercive Scalar Type Hints RFC From: kontakt@beberlei.de (Benjamin Eberlei) --047d7bacb11eb78dc2050fc49dbd Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Mon, Feb 23, 2015 at 6:08 PM, Zeev Suraski wrote: > > -----Original Message----- > > From: Benjamin Eberlei [mailto:kontakt@beberlei.de] > > Sent: Monday, February 23, 2015 6:54 PM > > To: Zeev Suraski > > Cc: PHP internals > > Subject: Re: [PHP-DEV] Coercive Scalar Type Hints RFC > > > > Zeev, > > > > On Sat, Feb 21, 2015 at 11:25 PM, Zeev Suraski wrote: > > > > > > Additional options we could entertain are: > > > > 5. Go for just E_DEPRECATED in 7.0. Change E_DEPRECATED to > > E_RECOVERABLE_ERROR in 7.1/7.2/8.0 (TBD). > > > > 6. Same as #5, but also provide a mechanism similar to declare() = as > > the temporary measure for strict campers to explicitly ask for > > E_RECOVERABLE_ERROR=E2=80=99s to be triggered. They will no longer be = necessary > > when we change E_DEPRECATED to E_RECOVERABLE_ERROR in 7.1/7.2/8.0. > > > > > > 5. BC Break too big leading to a Python2/3 situation, low adoption of > > PHP7, > > something that especially you couldn't want given that the perf > > improvements are what keeps PHP on level with HHVM. This automatically > > applies to all internal functions regardless if userland uses typehints > or > > not, > > wordpress will not work with this anymore, no performance comparisons > > anymore. > > I don't see how that would affect PHP 7 adoption at all actually. You ca= n > just disable E_DEPRECATED and your upgrade would be clean. Technically i= t > would have to wait to PHP 8 before we change it to E_RECOVERABLE_ERROR, > give > users several years to migrate. Just disabling E_DEPRECATED is hiding bugs now. The error gets triggered *because* somebody uses the wrong coercion rules, if i hide this, how am i going to fix it? Compare this to Smarty/FPDF/TCPDF. Extremly wide adoption libraries, still php v4 code. They throw strict errors and notices like nothing you have ever seen before, but nobody talks about turning them into errors in PHP7/8. Furthermore, you said before this will be only 1-2 years, now until 8 we have another 8-10 years. > Given we're talking about coercive rules > and not strict rules, I actually don't expect that many failures (initial > tests of Francois' patch results in 8% failures in our unit tests, and > that's before tweaking the rules in any way (and apparently, at least som= e > of them have to do with bugs in internal functions that can be easily > fixed). It doesn't strike me as a worse migration than we did getting ri= d > of magic_quotes or safe_mode. It can be done. > 8% is alot. Now you are lucky that you have unit tests. The kind of code that will rely on this conversion probably does not have a single test. magic quotes has a workaround you can put into an auto_prepend_file, *magically* making it work this way before again. This changes here have no workaround to keep the old mode. > I'm personally now leaning towards this option as the most viable one. I agree if we can avoid an INI setting, but this will surely lead to a Python 2/3 situation. > > > 6. Ok, so this is now getting very similar like v5 of the STH, but stil= l > > with much > > more BC breaks. > > Not at all. With the Dual Mode RFC, we're going to have declare() and tw= o > distinct modes even in 10 and 20 years from now, for all eternity. It's = a > new feature that's here to say. With this, these declare()'s are a > migration feature, that will be gone in several years. The endgame is > completely different. > Yes, I know, but it will not ever break BC with PHPv4/v5 compatible code. No upgrade problem for nobody. The problem with the coercive STH RFC is imho that ontop of introducing Typehints what we all want, it changes the ZPP rules. I would rather have a vote on v1 of the STH vs v5. And then changes to ZPP handling can be a completly different task, maybe for PHP8. > > Zeev > --047d7bacb11eb78dc2050fc49dbd--