Re: [RFC] [DISCUSSION] Scalar Pseudo-type
| From: | Fleshgrinder | Date: | Fri, 29 Dec 2017 17:24:30 +0000 |
| Subject: | Re: [RFC] [DISCUSSION] Scalar Pseudo-type | ||
| References: | 1 2 3 4 5 6 7 8 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-101446@lists.php.net to get a copy of this message | ||
On 12/29/2017 6:21 PM, lists@rhsoft.net wrote:
> no, when i accept "int|float" i don't get something converted at all and
> i can handle the cases different - when it#s silently casted to a float
> i have no way to know it was a int at call time
>
Again, obviously, the question remains, why would you care? Please
provide convincing arguments as this would become the body of the
corresponding RFC. Adding that type is super simple, the question is why
is it so super handy?
PS: Despite union and intersection types, they automatically allow this
form and I repeat that I am totally in favor of them. The question is
truly about
number only which would accept int and float (no
string).
--
Richard "Fleshgrinder" Fussenegger