PHP – POPO Object

Just a little post to show a POPO object (like POJO in Java) to beginners.

Example with a User :

How to instanciate a user :

How to get an attribute from a user :

How to set an attribute to a user :

Returning $this in set functions allows to chain calls.