Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:93924 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 58215 invoked from network); 12 Jun 2016 22:23:24 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 12 Jun 2016 22:23:24 -0000 Authentication-Results: pb1.pair.com smtp.mail=rowan.collins@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=rowan.collins@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.42 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 74.125.82.42 mail-wm0-f42.google.com Received: from [74.125.82.42] ([74.125.82.42:35558] helo=mail-wm0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E8/36-12403-AD0ED575 for ; Sun, 12 Jun 2016 18:23:23 -0400 Received: by mail-wm0-f42.google.com with SMTP id v199so55331647wmv.0 for ; Sun, 12 Jun 2016 15:23:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:references:from:to:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding; bh=thnKd499U2PN/xm7pWYTsB8iMs2hO72kegDfEbkGSmc=; b=jjApvKlHGsjrbEiMTlIXv2K0cTOZmK3evrPCKMGMSZjvZM7bEGDDxpettIDVgRA3Zd ZHWBvZMfbp1GuhoilR+9WDthCwDq/fNCGSWe4zWF1H3xkNltSrBhDAq89qXoh2PKslrh nHDBOddk8bL5mCT4HAsO5V4hIdzWZxgg8BCsMDdDXJP1tsQIcrlMK+ErQXkkysFaIxDL DPy+zFlxvr6e/uO96h4tEnKSBM+1d+g4RpXU8OgIIWq7od1ywpFZDjmh8PhcT5FxND04 7nt04kThRV3yFeuK2EftlbyvaOjNkppWI3QTxdW+yR5IzygJKk97oTAqCVy3+N0yxzZE zkEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:references:from:to:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=thnKd499U2PN/xm7pWYTsB8iMs2hO72kegDfEbkGSmc=; b=df+Cq5qNcmWMXfYjoXGU+IaCViG0WhYiZJkIgJfn/qY4tBGu9W37sCDLMuwr6/aROF 6bI1nRB9eEevA2PsYughWDhY/Iwo9r4xnbhUvuzhcUB7L8/dgvgGJYVq3rfhHKsGC5Yo n6uNFSdXEGof6nJt7MTuP3iuV9ZQnUb5RQYx8hJndCUaX4AHnXqMM+8zeMSqfetRqxSQ iZU7Jlm1PtDMP1HtrrGvgJxabea2kz8J7B+Izc1xX7K+BkFW/rn1ZLGjDKPqVLvAo577 5+379rN91v9eVskIhQC/by9sumGXrqbSlO3tpG+BrYTeVgZg9TVkpdAaDACHvvjJXzYb iPGw== X-Gm-Message-State: ALyK8tJVkj9oBRfRb5H5V0Mc07lzC7Km/WTUzREIFtEZSziZuFTBSA6OFgsSwTvAisuxxw== X-Received: by 10.194.41.170 with SMTP id g10mr6141286wjl.176.1465770199801; Sun, 12 Jun 2016 15:23:19 -0700 (PDT) Received: from [192.168.1.5] ([2.25.96.65]) by smtp.googlemail.com with ESMTPSA id uq7sm24210758wjc.19.2016.06.12.15.23.19 for (version=TLSv1/SSLv3 cipher=OTHER); Sun, 12 Jun 2016 15:23:19 -0700 (PDT) References: <6c03dafd-093a-0087-6312-96fede93c5f0@gmail.com> <027a527e-0920-9e57-b2cc-60fcbfedb84e@gmail.com> To: PHP Internals Message-ID: <03174fa7-a793-6792-1e04-20c88af55155@gmail.com> Date: Sun, 12 Jun 2016 23:23:17 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Is the "No BC Breaks in Minor Releases" policy enforceable? From: rowan.collins@gmail.com (Rowan Collins) On 12/06/2016 20:55, Nikita Popov wrote: > In that it is similar to the RFC on introducing warnings for invalid > numeric strings in arithmetic operations. Sure, that one introduces > only a notice while this one throws an exception. Most people probably > don't share this opinion, but I think there's actually very little > difference between the two for a professional codebase, which > (obviously ^^) has a zero notice/warning policy. In either case it's > something that must be fixed. (This means that the breakage, if > defined as "work required for a deployable upgrade", is probably much > much higher for the invalid arithmetic RFC, even though the breakage > as in "how badly is the code broken if I do nothing" is smaller.) OK, that at least is a specific line of reasoning. I don't agree with it, but I can respect its logic. For the record, I disagree because introducing an error changes program flow, whereas introducing a warning does not (except if there is some handler indiscriminately promoting warnings to errors, I guess, but I'm not aware that that is common practice). Even with a "zero notice/warning policy", it is possible to at least test your application without fixing a new warning; with a new error, you have to fix the problem before doing anything else. Or, more likely, you postpone adoption of the new version, which is surely something we wanted to avoid. > c) If you subscribe to defensive programming, the current behavior > implies that you should actually be adding an assert(isset($param)) > for each parameter to the start of your function, to ensure that your > **required** parameters are really passed. WTF? If I can't rely on > required parameters being required in this programming language, what > can I rely on at all? I'm willing to accept a small degree of BC > breakage to get rid of such nonsense. Unfortunately, this is still the case after this change: any parameter which can currently be omitted will also accept nulls. The only way of marking a parameter mandatory is to give it a type hint. So as the author of a function, this change makes absolutely no difference to your code; if you want a parameter to be mandatory, the solution in 7.1 as in 7.0 is to add a type hint. As the user of a function, it increases the visibility of an existing warning; since you claim any "professional codebase" will have a zero notice/warning policy anyway, this change will make no difference there either. Regards, -- Rowan Collins [IMSoP]