1 | <?php |
||
5 | class Popup |
||
6 | { |
||
7 | /** |
||
8 | * Popup configuration array |
||
9 | * |
||
10 | * @var array |
||
11 | */ |
||
12 | private $config = array(); |
||
13 | |||
14 | /** |
||
15 | * Constructor |
||
16 | * |
||
17 | * @param array $config |
||
18 | */ |
||
19 | public function __construct(array $config = array()) |
||
25 | |||
26 | /** |
||
27 | * Render the popup |
||
28 | * |
||
29 | * @return void |
||
30 | */ |
||
31 | public function render() |
||
38 | } |
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: