Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:97055 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 58562 invoked from network); 19 Nov 2016 16:49:23 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Nov 2016 16:49:23 -0000 Authentication-Results: pb1.pair.com header.from=rowan.collins@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=rowan.collins@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.49 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 74.125.82.49 mail-wm0-f49.google.com Received: from [74.125.82.49] ([74.125.82.49:38679] helo=mail-wm0-f49.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 0F/F0-53573-09280385 for ; Sat, 19 Nov 2016 11:49:20 -0500 Received: by mail-wm0-f49.google.com with SMTP id f82so81540221wmf.1 for ; Sat, 19 Nov 2016 08:49:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding; bh=WDs0RX7RE9lJM3Y/P3O1Yo366CFJsz713EqDvDKnaUg=; b=MP5Vjmyu8gDwmeHF14XCyUYtvNZ/5Ufahw3MdsAa+fj9dAtfmFjjkpbF1Fy7Lm9+kx TYDRZfEH/zWvNM/M/ZxLBSgXwyVHrns9hshy32I8dYZt3g9ZF0f8u4j+peK0YtCvs7Hv XcjOWCfPOQZvTd65TULC6uTvetrUmNtXPx0LK7eBfF3dWQ4qvb8VAMEpO3uXfr+2ZhZr 5POSSutjOcco/plChwVQimUbMmScGICXFWCv0qrbaFuG1ThZOCB2LnmVaPYcMxdTFqdM Lwn//HUq9xdcIp909Ase7IrSkZgRZ8dOy0rx08ZxkDu1x+JeK6BcftNJ0trL84RyUMIn LGmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=WDs0RX7RE9lJM3Y/P3O1Yo366CFJsz713EqDvDKnaUg=; b=mq7BiJTdiU9EglCVWi5nfOBP2Oy6f1BwKzAOeOXRHmMg0ClR3bIYDwh7ylQMfP9Tto NzfsSt/UK5M+JkdR1kps+bvcmsTyvH6X3eGxM7PdRInVq80Xg1UVwDAPnMiNdnhAC0tA GsCOstHuBcvqgj/e0Hpw2keIeKUu6s/PL5fEFLZufeE1CUb379QTOd5A9LoMRsJxmt75 M9n+iCHDKnUgPhN3T1wnvRuRkpJOQo9LguwLfosjzIReRLQAm6SDThSW4gax4SvO2V9P jcLaywdXuAyAY20rgiz8BDZnQlexOsH6I5SZLoODg7l5nEKpPbK0qxxuCOxLwKpgwNt2 DizA== X-Gm-Message-State: AKaTC03aHw/skT32J97T73YRFOSQrB8RPZEkRkazeA/HDlRWjdRYSOD+tEV8TL+CCTFg6Q== X-Received: by 10.28.199.71 with SMTP id x68mr4239553wmf.34.1479574157471; Sat, 19 Nov 2016 08:49:17 -0800 (PST) Received: from [192.168.1.5] ([2.27.88.157]) by smtp.googlemail.com with ESMTPSA id h2sm15011329wjy.40.2016.11.19.08.49.16 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 19 Nov 2016 08:49:16 -0800 (PST) To: internals@lists.php.net References: <576C4FE2.3090508@pascal-martin.fr> Message-ID: <1ecc40f7-b3c5-170a-c7a8-049379a10503@gmail.com> Date: Sat, 19 Nov 2016 16:49:16 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [RFC][Vote] Typed Properties From: rowan.collins@gmail.com (Rowan Collins) On 19/11/2016 14:04, Rasmus Schultz wrote: > lack of features > and consistency [...] where these features were engineered > into the language from the design stage, rather than being added on a bit > at a time. I think the consistency and "engineered in" parts of this are more important than people give them credit for. Adding type hints to a dynamic language is not a trivial thing; what do those type hints actually *mean*? > He actually had something like "public int $id" in a class-declaration on > his screen, and was genuinely confused - he simply assumed that would work What did he expect that declaration to do? Did he expect his program not to compile if he wrote some code that assigned a string? Did he expect to have to run a static analysis tool to detect errors? Did he expect the run-time to insert an assertion on every assignment and raise a runtime error? Did he expect this to happen even in production, or only in a development-only "checked" mode? All of these are possible behaviours, implemented in other languages. I've written some of my thoughts on how it *could* work in this blog post: http://rwec.co.uk/q/php-type-system Before we add type hints anywhere else in the language, I think we need to think about what we are actually working towards. Otherwise, we're going to end up with a mess of inconsistent rules because each set of type hints was added separately with slightly different semantics and caveats. Regards, -- Rowan Collins [IMSoP]