Oddbean new post about | logout
 I only use them when my get or set needs to do something non-standard.  Using them everywhere when the language supports default getters and setters on class properties just creates unnecessary clutter. 
 You mean, as you can access over the __construct() ? 
 I think so?  You might be thinking in PHP-specific terms I'm not familiar with.

As an example, though, I recently wrote a class for my day job that had a public `value` prop and a private `_value` state.  Changes to `value` updated `_value`, but not vice-versa, because the public one had a change listener and I needed a way to change it without triggering the listener.

However, were it not for that case, I would have just used a single class property `value` with no explicit getters or setters, because TypeScript defines get and set behavior by default on classes, without the need for developer code. 
 Hmm. I don't think PHP does that.