Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:83152 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 33735 invoked from network); 19 Feb 2015 07:23:55 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Feb 2015 07:23:55 -0000 Authentication-Results: pb1.pair.com smtp.mail=smalyshev@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=smalyshev@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.212.170 as permitted sender) X-PHP-List-Original-Sender: smalyshev@gmail.com X-Host-Fingerprint: 209.85.212.170 mail-wi0-f170.google.com Received: from [209.85.212.170] ([209.85.212.170:44986] helo=mail-wi0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 31/D1-22021-A8F85E45 for ; Thu, 19 Feb 2015 02:23:55 -0500 Received: by mail-wi0-f170.google.com with SMTP id hi2so993532wib.1 for ; Wed, 18 Feb 2015 23:23:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=Zfedo/IP3yf+qS5Cc1Ymqi0/LghmHSjFxSS2alweep8=; b=c+d4LjxHdUlMI3QR3NmGykaakMrpjUHiaMe+s1y7MspLi6arH5HT86MRelbXN2USO0 uHvl7zbyXnaMxMRKzBCWPWSQ9e4rMPrpthLb97YearCP6tzrn0xw5rGyUZZZf9jfR1Jc bMm5xaC7LN3BaJgs2qC4RLoju9mWECXHNY34+DOm2iypWzhv2Via144S/MydFXx1/gGI smUi8j78Z4G61XNbZEVl10clGNrRU7g1luTQCOCu2ZFQXkjg8HEK5CjxjivFjS56I2RH OaUTR+bY2c35Ni/9ZS9YwjCvDLBaBVJedNw05wPSZPFkE2p+Iz0SdCKzEjc7epOPVZDo dJkw== X-Received: by 10.194.157.68 with SMTP id wk4mr6076873wjb.123.1424330632043; Wed, 18 Feb 2015 23:23:52 -0800 (PST) Received: from Stas-Air.local (business-092-079-136-194.static.arcor-ip.net. [92.79.136.194]) by mx.google.com with ESMTPSA id et4sm36073750wjd.15.2015.02.18.23.23.50 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 18 Feb 2015 23:23:51 -0800 (PST) Message-ID: <54E58F86.5000001@gmail.com> Date: Thu, 19 Feb 2015 08:23:50 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Larry Garfield , internals@lists.php.net References: <011801d04a07$83ab1c00$8b015400$@php.net> <016f01d04a3a$e9183220$bb489660$@php.net> <022801d04ab1$4a0c47d0$de24d770$@php.net> <1913e09d7f52541901d8574d2080a63f@mail.gmail.com> <7a5d96b34b98ec1f3ee17be7fa6a1e81@mail.gmail.com> <2CBDEB67-3DE3-437D-9AF3-0E6A92027244@zend.com> <4cc0c81c7199a452534bb8edcdb19914@mail.gmail.com> <54E589F6.9030002@garfieldtech.com> In-Reply-To: <54E589F6.9030002@garfieldtech.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Reviving scalar type hints From: smalyshev@gmail.com (Stanislav Malyshev) Hi! > 2) PHP would benefit hugely from static analysis tools and compile-time > type-based optimizations, but those are only possible with code that is > strongly typed. Currently such tools do not really exist, but with Is that really the case? Javascript has very good optimizing engine, and Javascript has no typing. Of course, it is probably *easier* with strict types, but harder and impossible are two very different things. In fact, I do not see large benefits for static analysis from scalar typing - execution path rarely is different depending on if something is integer or string, except for obvious is_* check - but those are rarely controlling any useful logic. It may be different depending on if it's a scalar or an object - but that we already have covered. -- Stas Malyshev smalyshev@gmail.com