3 ms·
You technically can use getters and setters in PHP, albeit with a noteworthy bit of extra implementation associated with wiring up __get() and __set().
by exikyut 5y ago
You 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).