Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:83622 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 69341 invoked from network); 23 Feb 2015 23:12:16 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 Feb 2015 23:12:16 -0000 Authentication-Results: pb1.pair.com header.from=ircmaxell@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=ircmaxell@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.217.179 as permitted sender) X-PHP-List-Original-Sender: ircmaxell@gmail.com X-Host-Fingerprint: 209.85.217.179 mail-lb0-f179.google.com Received: from [209.85.217.179] ([209.85.217.179:44088] helo=mail-lb0-f179.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id F0/B1-61054-0D3BBE45 for ; Mon, 23 Feb 2015 18:12:16 -0500 Received: by lbiz12 with SMTP id z12so21273684lbi.11 for ; Mon, 23 Feb 2015 15:12:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=CyTBCjJQV0nhb8B4OpFfG/aBcDb7I9YhvKCm9QrEGgk=; b=rPJ4nZfc66H47qMrvZINvntikjXLsR/hLqcZkUvC4Hm1ovuHCspoMCbGcoty3viFOh 7hDwIpg+y55jYzwviFLyEXaw845T4opG4RxgCV5UIVN6sgddYrJmtmUlj8uqgSVQfM37 zIy7GEl8WEnb73/vxQWd6VyYoE9cQJe9ghzbcIs8tU++ynFpjWngI0xWsSCbFqTHVgzj sg4ZkTJxyfiHKHx1L2uBca8Os3z+u+GEyd94Y4p/d+QEYD8mPdV0S7B6hEDeCqlJPufB l4rYp+T1ZOHwrlHFsCrvQCh64Voqg00eDAdAoQLhyLtTEqx6YxFn8YMBYWFnNYt7c7E3 0VqA== MIME-Version: 1.0 X-Received: by 10.112.139.136 with SMTP id qy8mr12003088lbb.38.1424733133156; Mon, 23 Feb 2015 15:12:13 -0800 (PST) Received: by 10.25.43.9 with HTTP; Mon, 23 Feb 2015 15:12:12 -0800 (PST) In-Reply-To: <408f8a8532601425b1c501f333fa6135@mail.gmail.com> References: <7ef509ef10bb345c792f9d259c7a3fbb@mail.gmail.com> <9aec85c81b49009c6238ff6d8be27cd4@mail.gmail.com> <2dcfd9f4a3f0f9bbf2a13f679359e6ea@mail.gmail.com> <6844321d7134506b1061c5f18a275069@mail.gmail.com> <408f8a8532601425b1c501f333fa6135@mail.gmail.com> Date: Mon, 23 Feb 2015 18:12:12 -0500 Message-ID: To: Zeev Suraski Cc: PHP internals Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] Coercive Scalar Type Hints RFC From: ircmaxell@gmail.com (Anthony Ferrara) Zeev, On Mon, Feb 23, 2015 at 5:53 PM, Zeev Suraski wrote: > Anthony, > > Thanks for testing, but it's a bit premature to jump to conclusions. > > First, disabling phar is in the patch instructions at > github.com/php/php-src/pull/1110 - it's a bug in phar that needs to be > fixed. We'll address it. Well, my point was more that it's an indication of the scale of breaks to expect. > Secondly, as was obvious both from Francois' email and mine, this is just an > initial patch, and yes, we know it presently fails 8% of the test cases (as > I stated a few hours ago in an email to Benjamin). I still think it's not a > bad start at all; It would be a pretty bad ending, but I think we can tweak > the rules to get a lot less breakage. If you're up for it, you can > experiment with the many the 12 configuration switches that govern this > patch - but even that is a bit premature. Let people who actually want this > RFC to pass try and tweak the patch first :) My concern though is that if you do tweak the rules to get a reasonable amount of breakage, you're also going to remove all of the benefit of the type conversions you proposed. For example: A number of the issues that I saw with phpunit were related to passing bool to string and null to string. So to prevent those, you'd need to accept bool and null for strings. Which brings strings back precisely to the way they are today. So no changes. I saw the same things with int (specifically around debug_backtrace(false), where the first parameter is a bitmap). I couldn't get it to go far enough in (without spending 30 minutes debugging phpunit) to actually run a test. I tried disabling all bool/null checks in the patch, but am simply getting segfaults now. Will look at it a bit more later. > Thirdly, as I shared earlier, the RFC was updated to go for E_DEPRECATED in > PHP 7, which means there would be zero breakage in PHP 7, and ample time for > people to migrate whatever issues this would introduce to their code until > PHP 8. All functionality changes will go through the E_DEPRECATED cycle, > exactly like the stuff that got removed in PHP 7. Well, I am concerned at this error rate we're seeing that we won't cause significant perf degradation due to the errors (even with reporting=0). And that's not mentioning log files. > Last, we don't yet have an answer to your question about the billions of > lines of code out there. But as I told to Benjamin, we have every intention > to try the patch out on some real world apps and see how it performs. > > Let me assure you that if we find that there are hundreds of issues trying > to get common apps to work, after we tweak the rules - I'll either retract > the RFC or the very least rethink the internal functions part of it. Sounds great. My concern here though is that my instinct says that either the rules are going to come out so similar to today's rules as to not be effective, or break enough code that it's not worth it. Please continue the patch, and let's test iterations. I just don't see where the magic line will be (not breaking too much while providing enough benefit to please the proponents of strict types). Thanks Anthony