Re: [RFC] Keep type of reference params
| From: | Manuel Canga | Date: | Sat, 09 May 2020 17:44:40 +0000 |
| Subject: | Re: [RFC] Keep type of reference params | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-110100@lists.php.net to get a copy of this message | ||
---- En vie, 08 may 2020 13:03:59 +0200 Thomas Gutbier <thomas.gutbier@anthrotec.de>
escribió ----
> Isn't that already solved for typed properties?
>
> Consider this:
>
> class A { public static int $number = 5; }
> $num = &A::$number;
> $num = "String";
>
> This will result in an uncaught TypeError,
> see https://3v4l.org/XC6hk
>
> I would think, it would be consistent if referenced parameters
> behaved in exactly the same way.
>
> Regards,
> Thomas
>
>
Hi, Tomas,
That option was my first thought. However, people( and me ) I know, normally use local vars for
function calls.
Thanks Thomas for your opinion.
Regards
--
Manuel Canga