Johannes Schlüter wrote on 30/03/2016 13:18:
Maybe we should actually discuss making PHP fully typed and making that
consistent instead of adding one piece of typing step by step.

This gets an imaginary +1 from me.

Function/method parameters and return types make sense as a special case, because they are "signatures" with lots of special meaning already (interfaces, inheritance variance checks, etc).

Cool though the work on this RFC looks, it feels kind of experimental, like Sara's operator overloading extension [1]. It introduces a new idea of a "typed property" which has arbitrarily different behaviour from normal properties and from other kinds of variable (local variables, static properties, array values, etc). From an implementation point of view, I totally understand why, but from a language user's point of view, I'm not sure making such a strong distinction really makes sense.

Alternatively, perhaps this work could be re-purposed in combination with some form of getter/setter syntax sugar, to produce true properties, as a separate concept from members? This would make the lack of support for statics and references make much more sense, and feel more like a full feature in its own right.

[1] https://github.com/php/pecl-php-operator

Regards,
--
Rowan Collins
[IMSoP]

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to