| 1 | <?php |
||
| 7 | class ResultQueue |
||
| 8 | { |
||
| 9 | |||
| 10 | const RESULT_MAX_SIZE = 5120; |
||
| 11 | |||
| 12 | private $dequeuedCount = 0; |
||
| 13 | |||
| 14 | public function __construct($ownerPid) |
||
| 20 | |||
| 21 | public function enqueue($result) |
||
| 25 | |||
| 26 | public function dequeue() |
||
| 38 | |||
| 39 | /** |
||
| 40 | * @return int |
||
| 41 | */ |
||
| 42 | public function dequeuedCount() |
||
| 46 | |||
| 47 | public function __destruct() |
||
| 54 | } |
||
| 55 |
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: