1 | <?php |
||
5 | trait ManageErrors |
||
6 | { |
||
7 | /** |
||
8 | * Return the last error number. A value of 0 means no errors. |
||
9 | * |
||
10 | * @param Connection|null $linkIdentifier |
||
11 | * @return int |
||
12 | */ |
||
13 | public function errno(Connection $linkIdentifier = null) |
||
19 | |||
20 | /** |
||
21 | * Return the last error text. |
||
22 | * |
||
23 | * @param Connection|null $linkIdentifier |
||
24 | * @return string |
||
25 | */ |
||
26 | public function error(Connection $linkIdentifier = null) |
||
32 | } |
||
33 |
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: