20 ms·
I sometimes wish I'd never learnt C#. I love property accessors, as I consider properties to be a part of public API and in PHP, there's no nice way around it o
by fart32 5y ago
I sometimes wish I'd never learnt C#. I love property accessors, as I consider properties to be a part of public API and in PHP, there's no nice way around it other than the boilerplate getters and setters.
Also I hope we'll get generics at some point. I know there are some issues with their implementation, but even non-runtime enforced generics would be better then relying on a docBlock annotation.
Enums are neat, though.
- exikyut 5y agoYou technically can use getters and setters in PHP, albeit with a noteworthy bit of extra implementation associated with wiring up __get() and __set().
- fart32 5y agoSure you can, the question is if you should. And you can't declare properties on interfaces (well, you can use @property annotation, but that's just... an annotation).