1 | <?php |
||
11 | trait Join |
||
12 | { |
||
13 | /** |
||
14 | * Join array elements with a string |
||
15 | * |
||
16 | * @param string $glue |
||
17 | * |
||
18 | * @return string Returns a string containing a string representation of all the array elements in the same order, |
||
19 | * with the glue string between each element. |
||
20 | */ |
||
21 | 1 | public function join($glue = '') |
|
25 | } |
||
26 |
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: