Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:83809 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 98764 invoked from network); 25 Feb 2015 17:39:49 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 25 Feb 2015 17:39:49 -0000 Authentication-Results: pb1.pair.com header.from=zeev@zend.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=zeev@zend.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 209.85.223.171 as permitted sender) X-PHP-List-Original-Sender: zeev@zend.com X-Host-Fingerprint: 209.85.223.171 mail-ie0-f171.google.com Received: from [209.85.223.171] ([209.85.223.171:41925] helo=mail-ie0-f171.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 3D/C1-20665-4E80EE45 for ; Wed, 25 Feb 2015 12:39:48 -0500 Received: by iecrd18 with SMTP id rd18so6894256iec.8 for ; Wed, 25 Feb 2015 09:39:45 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:references:in-reply-to:mime-version :thread-index:date:message-id:subject:to:cc:content-type; bh=Na682tq3SmqAfQ0lMpbS3fTwgiX9K8rd+glg76DgA1I=; b=exqjI3D47aTmRmV/S/7mbtn3cZZ0laDLFCDIKVSmmxq2JPGp1WqB3UyuaPq4xdXTGH 35xOTGhF3UKuIYNsCX5IdoV1TyCVjmX5GyM4hBAZ1RKfK36iwy0cx9AWSP7NoccCj/ZN npBWCj1Un9J2PD0DY5Bsi3+2Kg+08rbKzDmpbHKXdEpnestHr6096Eq6zc8GYD40A3Bg TVlrpxhSb0gyW+z15tfLbISaS/wrZE0iRKrR5KJPer8FXCc3RHidRdW/JRntZywQl4IY AJ+Sz8Kw1fjBC44FuDAO0lJ0yw2gH8P41tKkKkhKESctChTM3UOaGnQD2O3wOSJI95lG CfoA== X-Gm-Message-State: ALoCoQkwF0oefmgT3XAGpMQmm/U3xEXtwgE8Cv6g6VJ/R99JD4R1e5u5uSUn/fzg2TeMofDAGts82JwydR8pAziSC360JkJQBxnwEC5yIC4Zx1i+deGWmpgCRSFHbzXsAOk07MhvQi4JkSsCyc9yzOOqtAMVxdgz3g== X-Received: by 10.50.30.202 with SMTP id u10mr28423341igh.35.1424885985352; Wed, 25 Feb 2015 09:39:45 -0800 (PST) References: In-Reply-To: MIME-Version: 1.0 X-Mailer: Microsoft Outlook 14.0 Thread-Index: AQNRCtsuxpDhJkWLwbpkER3sGaOi3AHrYI7jAdlgWoQBRyBzfwIiz2rpAZsjMygCI8NzqpmovSpg Date: Wed, 25 Feb 2015 19:39:44 +0200 Message-ID: <1943eb934e5e08f32eddd157fd49381e@mail.gmail.com> To: Shashank Kumar Cc: PHP internals Content-Type: text/plain; charset=UTF-8 Subject: RE: [PHP-DEV] Re: [RFC-Discuss] Scalar Type Declarations v0.5 From: zeev@zend.com (Zeev Suraski) > -----Original Message----- > From: Shashank Kumar [mailto:shashankkumar.me@gmail.com] > Sent: Wednesday, February 25, 2015 2:54 PM > To: Dmitry Stogov > Cc: Anthony Ferrara; internals@lists.php.net > Subject: Re: [PHP-DEV] Re: [RFC-Discuss] Scalar Type Declarations v0.5 > > On Wed, Feb 25, 2015 at 4:30 AM, Dmitry Stogov > wrote: > > As I understand the proposal and above example, it's possible to change > the > 'strict_type' settings per file. > So, for an enterprise application being developed over many years, it's a > very > realistic scenario that this setting will be different in different files > especially > if coding conventions are not followed (happens very often). > > Does that mean when reading or writing code, in addition to checking the > signature of a function, I have to check the 'strict_types' setting at the > top as > well, to understand how that signature behaves? Not quite; You need to check the strict_types setting not where the function is defined, but where the function call is being made. It means that if you're editing other people's code, you first need to check what mode you're at, as it will determine the semantics of function calls in the file you're editing. Independent of the issues I see with strict types themselves, I think the concept of a dual mode has two substantial disadvantages: - It's an extra element to worry about when determining what your code will behave like. Yes, it's self-contained in the file - which is an advantage of INI entries, but it's still another thing to worry about. - As your question suggests, I think we have substantial evidence that the nature of this dual mode will be confusing to users. And we're not talking about the average users - we're talking about internals@ subscribers, some of which are big community leaders (sorry Matthew :). Combined, it's additional cognitive burden on the developer base, and it may also be divisive (e.g. "I only use libraries written with strict mode" or vice versa). That's why in the Coercive RFC we sought to find a combined ruleset that does away with these disadvantages, while doing its best to cater to the key needs of both camps, with the endgame being having just one camp. Zeev