Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:105110 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 35638 invoked from network); 5 Apr 2019 16:31:45 -0000 Received: from unknown (HELO mail-it1-f169.google.com) (209.85.166.169) by pb1.pair.com with SMTP; 5 Apr 2019 16:31:45 -0000 Received: by mail-it1-f169.google.com with SMTP id w15so9492039itc.0 for ; Fri, 05 Apr 2019 06:27:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=wB5b9rURcOmqJ56AMUCRoTwPiBe8LNKYwNFtlFE6qzk=; b=fxfsrPG/gQcRpGnmiXZ+XSvLvzXDg3hV+j1ZIBejwZJoDqflCnFL8ZrPqaPrP+4EbE 4VUgz1TLHLbAKqKcBVj1MBa6uVd2k7pZ4pZyhVzrAMaH1y4ZUJB3isRFCE1MzGSgPlxF EKdkqHdL+I6XNVJDiEQiAA9E7jlNmf393b5MvjomsTS7Hovh/DWCUEfMDUjbr5t/ZRU3 1AkBWqSwrNIkigm7L1U+48qOuzZCq04xACLoiTSO3uMpIlrGPdSq67jX08fz8M0kXdw2 OIAgf8rTUcCG+JZ8x4pYv0SlrHHSqq5L1mxciHJZL7zRKpDATMVl1llI3rWBA7HA0Omh BrRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=wB5b9rURcOmqJ56AMUCRoTwPiBe8LNKYwNFtlFE6qzk=; b=t475KYH9F9QokAWdXh/ZG8oz5+JonOWhTwSlhEWX4JMB9DTVdGhyizk/UJROkNnNVJ 5QURN6qlWMmlBn5l3gzsmEe9hEM8hM9SICECRh14mMMdz9jKb716ADS7jfAz3GYecZw1 lxcwUtpbBVDI8hi9/cxlipVQeHECHS+P0+r3ywgQ2vULgrYjUZNbEJ88RQX/69RG5Baq r1HBVM8uFVp/pufnhi5Qo5KdxpGPdbTLVjPFtpwTjpkuzf61W0+0s3eKNS6j+taDow7Q pYalSIJLcTe+00rFfyyqIgH0xWvB1dc1t5sh1FbnUhYZxF3Ag2iCTBFlciXqy6EPjPCT Z2tg== X-Gm-Message-State: APjAAAUAg2TpbZO8nng2HB6sC96eQUv/FmE8hRv1PWhankLcvd4mLAT1 zStcof8oxoBk5UslzYc66Shuqdba4NFGBZRf+ihMLU+F X-Google-Smtp-Source: APXvYqzEj7fpB6M8j81tWNB+RXtKklEycViiBe1jw6eYGIXKD1hXhD+RSoXZMA++OT2qg47+8tvFxE4g0BTdSP6xsc4= X-Received: by 2002:a24:3a13:: with SMTP id m19mr8959684itm.88.1554470858838; Fri, 05 Apr 2019 06:27:38 -0700 (PDT) MIME-Version: 1.0 References: <65AF9E1E-DFA6-47AE-952B-9ABEBD9B6038@gmail.com> <284d1f9f-03d3-1488-77dd-82e18edf9f4c@gmail.com> <3144F5D1-1F18-4C42-9B3E-AF1B1E598E47@koalephant.com> <917cb7bc-4abc-4bae-1a5a-b2ba1777fa55@gmail.com> In-Reply-To: Date: Fri, 5 Apr 2019 14:27:27 +0100 Message-ID: To: PHP internals Content-Type: multipart/alternative; boundary="0000000000005ad6120585c8737e" Subject: Re: [PHP-DEV] Question about adding !function_identifier From: rowan.collins@gmail.com (Rowan Collins) --0000000000005ad6120585c8737e Content-Type: text/plain; charset="UTF-8" On Fri, 5 Apr 2019 at 14:05, Robert Hickman wrote: > > I think you're misunderstanding the problem: it's not that the > *programmer* doesn't know the types, it's that the *analysis tool* doesn't > know them, because the programmer hasn't told it, and currently has no way > to tell it. > > > > If the static analyser was programmable, it would be possible to > provide it such information, within the scope of a single code base. > I'm not really sure what you're suggesting; the normal way to "program" a static analyzer is to add more and richer type annotations to your code, as in the over-the-top example I gave (in reality, the analyser can deduce some of the types, and the syntax needn't be quite that ugly). The problem is that PHP has a lot of features where there is currently no way to specify types (callbacks, iterators, etc), and some where it's essentially impossible to do so in a checkable way ($$foo, $foo->$bar, etc). I'm not saying it's not possible, it's just a considerable project to rewrite a dynamic language into a statically typed one, and at the moment Hack is much further into that project than PHP, partly because it has less concern about backwards compatibility. Regards, -- Rowan Collins [IMSoP] --0000000000005ad6120585c8737e--