Conditions | 2 |
Paths | 2 |
Total Lines | 7 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
34 | public function offsetExists($offset) { |
||
35 | try { |
||
36 | return $this->get($offset); |
||
1 ignored issue
–
show
|
|||
37 | } catch(OutOfBoundsException $e) { |
||
38 | return false; |
||
39 | } |
||
40 | } |
||
41 | |||
49 | } |
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: