Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:81880 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 8233 invoked from network); 5 Feb 2015 08:58:23 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 5 Feb 2015 08:58:23 -0000 Authentication-Results: pb1.pair.com smtp.mail=francois@tekwire.net; spf=softfail; sender-id=softfail Authentication-Results: pb1.pair.com header.from=francois@tekwire.net; sender-id=softfail Received-SPF: softfail (pb1.pair.com: domain tekwire.net does not designate 212.27.42.2 as permitted sender) X-PHP-List-Original-Sender: francois@tekwire.net X-Host-Fingerprint: 212.27.42.2 smtp2-g21.free.fr Received: from [212.27.42.2] ([212.27.42.2:11042] helo=smtp2-g21.free.fr) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 89/F9-51979-EA033D45 for ; Thu, 05 Feb 2015 03:58:23 -0500 Received: from moorea (unknown [82.240.16.115]) by smtp2-g21.free.fr (Postfix) with ESMTP id E46274B027D; Thu, 5 Feb 2015 09:55:01 +0100 (CET) Reply-To: To: "'Stanislav Malyshev'" , "'Andrey Andreev'" Cc: "'Sebastian Bergmann'" , References: <00c101d04049$ca411ec0$5ec35c40$@tekwire.net> <54D1CA7C.8060204@php.net> <54D1E6EC.7060702@php.net> <54D2B3FA.6020900@gmail.com> <54D2C018.6050803@gmail.com> In-Reply-To: <54D2C018.6050803@gmail.com> Date: Thu, 5 Feb 2015 09:58:14 +0100 Message-ID: <01a501d04121$e0b81130$a2283390$@tekwire.net> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Outlook 14.0 Thread-Index: AQI+MKsMv6zrm7KCv5jpZIs/BqhffwHJ9dvJAVdrBXgBsC3UswHm0N93AfLB7ygB8dXUSgG+dkBoAbjr4f4B2jxiGQH82FNpm3aCFEA= Content-Language: fr X-Antivirus: avast! (VPS 150204-1, 04/02/2015), Outbound message X-Antivirus-Status: Clean Subject: RE: [PHP-DEV] What do we need strict scalar type hints for? From: francois@tekwire.net (=?utf-8?Q?Fran=C3=A7ois_Laupretre?=) > De : Stanislav Malyshev [mailto:smalyshev@gmail.com] > > Adding another concept, not changing the existing ones. And really, > > it's just simplifying what is already present via is_() > > runtime checks, making our lives a little bit easier. >=20 > There's a very big difference between allowing to check types (and = then > do whatever you wish) and having functions throw fatal errors if types > do not match. +1. Checking IS_ at the C level after implicit conversions and = checking this at the PHP level are very different. IMHO, the key point is the concept of 'type'. Strict typing considers a = one-to-one correspondence between PHP types and zval types, which is = nonsense. At the PHP level, any value returning true through = is_numeric() IS a 'number', and it must remain so. Any such value with a = null decimal part is an 'integer' (not the result of 'is_int()') and so = on. As long as we don't agree on 'smart' high-level types and the = corresponding matching rules against zval type and value, we won't agree = on anything. This is what I am currently defining in the upcoming DbC = RFC. Hopefully, a first version will be released tomorrow, depending on = Yasuo's and Dmitry's opinion. Cheers Fran=C3=A7ois