Am 08.05.2020 um 12:37 schrieb G. P. B.:
I think everyone can agree this is useful. But the issue here is the
implementation. Because from what I know PHP's references are aspecial
kind of pain in the engine.
That's why the common wisdom is to use references in PHP as least as possible.
And IIRC what you are trying to achieve would need a major overhaul of how
references work and someone who wanted to tackle this would have done it on
their own and propose an RFC at the same time.
So sadly unless something semi-concrete shows up, I'm considering this a
pipe dream.
But I'd gladly be shown otherwise.
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
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php