Re: Coercive Scalar Type Hints RFC
| From: | Pavel Kouřil | Date: | Sun, 22 Feb 2015 19:02:13 +0000 |
| Subject: | Re: Coercive Scalar Type Hints RFC | ||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-83480@lists.php.net to get a copy of this message | ||
On Sun, Feb 22, 2015 at 7:30 PM, Robert Stoll <php@tutteli.ch> wrote:
> Hi Pavel,
>
> Yes, I am suggesting to make conversions behave the same regardless if it is implicit or
> explicit. The only difference between the two should be that one is stated explicitly by the user
> where the other is applied implicitly. Other programming languages behave like this and are more
> predictable for users as well as developers because one does not need to learn two sets of
> conversion rules.
>
Actually this is not true. Other languages have differences between
explicit conversions (aka casting) and implicit conversions as well.
C# is the language I use the most after PHP, so I'll bring that one up
(see https://msdn.microsoft.com/en-us/library/ms173105.aspx),
but I
believe other languages (probably Java?) act the same way.
Regards
Pavel Kouril