| 1 | <?php | ||
| 4 | class AbstractOS { | ||
| 5 | /** | ||
| 6 | * Constructor | ||
| 7 | */ | ||
| 8 |     final public function __construct(\App\Device $device) { | ||
| 11 | |||
| 12 | /** | ||
| 13 | * Get Magic Function | ||
| 14 | * @param mixed $e Element to return | ||
| 15 | * @return mixed | ||
| 16 | */ | ||
| 17 |     final public function __get($e) { | ||
| 27 | |||
| 28 | /** | ||
| 29 | * Isset Magic Function | ||
| 30 | * @param mixed $e Element to check | ||
| 31 | * @return boolean | ||
| 32 | */ | ||
| 33 |     final public function __isset($e) { | ||
| 36 | } | ||
| 37 | 
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: