1 | <?php |
||
18 | class Ternary extends Branch |
||
19 | { |
||
20 | /** |
||
21 | * Constructor. |
||
22 | * |
||
23 | * @param string $operator |
||
24 | * @param Node $condition |
||
25 | * @param Node $then |
||
26 | * @param Node $else |
||
27 | */ |
||
28 | 3 | public function __construct($operator, $condition, $then, $else) |
|
36 | |||
37 | |||
38 | /** |
||
39 | * @{inheritDoc} |
||
40 | */ |
||
41 | public function compile(Buffer $buffer) |
||
55 | } |
||
56 |
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: