Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:82531 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 75813 invoked from network); 12 Feb 2015 13:03:21 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 12 Feb 2015 13:03:21 -0000 Authentication-Results: pb1.pair.com smtp.mail=php@beccati.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=php@beccati.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain beccati.com designates 176.9.114.167 as permitted sender) X-PHP-List-Original-Sender: php@beccati.com X-Host-Fingerprint: 176.9.114.167 spritz.beccati.com Received: from [176.9.114.167] ([176.9.114.167:53258] helo=mail.beccati.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 83/C4-50473-794ACD45 for ; Thu, 12 Feb 2015 08:03:21 -0500 Received: (qmail 31294 invoked from network); 12 Feb 2015 13:03:15 -0000 Received: from home.beccati.com (HELO ?192.168.1.202?) (88.149.176.119) by mail.beccati.com with SMTP; 12 Feb 2015 13:03:15 -0000 Message-ID: <54DCA48D.8090400@beccati.com> Date: Thu, 12 Feb 2015 14:03:09 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: =?UTF-8?B?UGF2ZWwgS291xZlpbA==?= , Andrea Faulds CC: "guilhermeblanco@gmail.com" , Zeev Suraski , Rasmus Lerdorf , PHP Internals References: <8703B53E-2C4A-4AC6-95C4-D4F19C6D5221@ajf.me> <54DAF884.7000508@lerdorf.com> <203e611c8e0b03568a868b8d931aec37@mail.gmail.com> <61E01A7C-C5C8-447F-A8FA-E12A18E847CA@ajf.me> In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [PHP-DEV] [VOTE] Scalar Type Hints From: php@beccati.com (Matteo Beccati) On 12/02/2015 13:39, Pavel KouĊ™il wrote: > Well, about "number" type hint. How this would work, in combination > with strict types? > > function bar(float $f) { > return $f * 1.23; > } > > function foo(number $x) { > return bar($x); > } > > foo(1); > > From my understanding, it wouldn't? This particular example would break with strict types as 1 is not a float, but then it's the fault of whoever wrote the function foo, that accepts a "number" and uses it to call one only accepting floats. Cheers -- Matteo Beccati Development & Consulting - http://www.beccati.com/