Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:101563 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 88812 invoked from network); 6 Jan 2018 20:12:53 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 6 Jan 2018 20:12:53 -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 209.85.128.182 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 209.85.128.182 mail-wr0-f182.google.com Received: from [209.85.128.182] ([209.85.128.182:36823] helo=mail-wr0-f182.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D7/72-45945-4CD215A5 for ; Sat, 06 Jan 2018 15:12:53 -0500 Received: by mail-wr0-f182.google.com with SMTP id b76so7190040wrd.3 for ; Sat, 06 Jan 2018 12:12:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding:content-language; bh=SJD0/AefGoHsQurBMx9meY1+zpsw/CA+vHh+hm0d8CE=; b=lIJjygbynxv+OOabOgJ71WCEZuOAV5wXXovqGC067BgMi9Lzjf8sHi4fZw+rV3nSub 45wrJEXZKtfpCHpoCdiJyTY3SjgTpLdhVFiU/nIOhSasYhJiDFQiNbrEae7STBKXsZGx K+VJ+K4SSVdANAP7t57euKhkNpE7ejNMWbUw3LCv+uiPwifqy1nbpkk3W6RLuZmIP9zp aiSDpis71Lydi+g8ebLTmqBJJ5Jsifle4p8Qn1W6/hf6HV0IO6VMFUotUAM2SEnzN697 YiJRaEbQGdykeh3mSfOLGwbUiCgE+d946YKQWbqqiUFvjKAQftEcUYLoWwOGFybdXJcg aqcg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=SJD0/AefGoHsQurBMx9meY1+zpsw/CA+vHh+hm0d8CE=; b=aRURGboBDu992sz3XWi5qxHWHrTuO1dX3BN3XkCoMCQFwLCTYTrlmdkuB7uSqgTsI/ R9Tzv0WFSIDd7dn4+RgrLoPMu2b3cRExERYpiMCNm0u6oQL5XxMoaZDrY86JYr8cRvEJ kIUFwJ9hO2uhiw3IbMXhlhBoxQEyPqgW6V1oUFE2++KBwT9FRJP1pavPzH9tz06ipiIK TAZyKWLGC4AxGanx/eXVV4HiYH/6OJrK1fjgERfcYwV3Ghd9uzshj5AosUMgnYy5hqoH um3mh+IcaJAwocMYEWWk9vIvtfGtQ4sB35uFWRoJ1gGj7HWznQtpQXx6sDzXHs6RxVGc nvow== X-Gm-Message-State: AKGB3mIjPadD2sd45wC3yO7hQYQOwSjxRBx+IEHY15SYJNA9/rYhsoI6 UFcvcg4NEo92TGKojtK10uo6QA== X-Google-Smtp-Source: ACJfBovpLLEmhEzwiFFY2Ji5kZjbgE93TcwkTgS/PyZu8ULCufN47Lw2rqyO8RWYcS5XxmDKmY9e2w== X-Received: by 10.223.154.170 with SMTP id a39mr5801932wrc.48.1515269569522; Sat, 06 Jan 2018 12:12:49 -0800 (PST) Received: from ?IPv6:2a00:23c4:4b81:ae00:6cdb:7b98:d1eb:7ee4? ([2a00:23c4:4b81:ae00:6cdb:7b98:d1eb:7ee4]) by smtp.googlemail.com with ESMTPSA id q32sm7417945wrb.95.2018.01.06.12.12.48 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 06 Jan 2018 12:12:48 -0800 (PST) To: internals@lists.php.net References: <9a3a8760-f65a-a5c0-b318-1830a9a986c3@gmail.com> <9352F6DF-9940-49A2-9B1D-FA9258E9738E@lerdorf.com> Message-ID: Date: Sat, 6 Jan 2018 20:12:48 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-GB Subject: Re: [PHP-DEV] [RFC][DISCUSSION] Strong Typing Syntax From: rowan.collins@gmail.com (Rowan Collins) On 05/01/2018 09:50, Lester Caine wrote: > 'Simply' adding a crude type check with it's overheads does not remove the > validation requirements which still need to be handled much of the time. Yes, I'd love to be able to define custom types like "integer in the range 0 to 100" or whatever. > But 'error' may not be the right response EVEN with just the simple type check I think one of the big distinctions is between validation of a value being received from somewhere (can only happen at runtime), versus verifying the validity of a piece of code (would ideally happen at compile time). Maybe we could have a different syntax to define a function with a compile-time constraint that the value was provably of the right type. With custom types, that could then prove that some validation check had already passed. That's kind of what the offline type checkers that other languages offer do, it's just up to you to run them before deploying your code somewhere important. Regards, -- Rowan Collins [IMSoP]