Re: [VOTE] Scalar Type Hints
| From: | Matteo Beccati | Date: | Thu, 12 Feb 2015 13:03:09 +0000 |
| Subject: | Re: [VOTE] Scalar Type Hints | ||
| References: | 1 2 3 4 5 6 7 8 9 10 11 12 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-82531@lists.php.net to get a copy of this message | ||
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) {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/return $f * 1.23;} function foo(number $x) {return bar($x);} foo(1); From my understanding, it wouldn't?