In Java 1.5.x and later they got annotations and we can use the same in PHP: class Employee { /** @var int */ var $employee_id; /** @var string */ var $name; /** @var string */ var $surname; /** @var timestamp */ var $since; } Yes, doc-comments. Not only we added documentation to our code (which is always a good thing), we can also use them for the type-definition. With the help of Reflection we