| 1 | <?php |
||
| 20 | class ArrayAccess implements \ArrayAccess |
||
| 21 | { |
||
| 22 | protected $values = []; |
||
| 23 | |||
| 24 | /** |
||
| 25 | * Checks wether a given offset exists. |
||
| 26 | * |
||
| 27 | * @param mixed $offset the offset |
||
| 28 | * |
||
| 29 | * @return |
||
| 30 | */ |
||
| 31 | public function offsetExists($offset) |
||
| 35 | |||
| 36 | /** |
||
| 37 | * returns the value for agiven offset. |
||
| 38 | * |
||
| 39 | * @param mixed $offset the offset |
||
| 40 | * |
||
| 41 | * @return |
||
| 42 | */ |
||
| 43 | public function offsetGet($offset) |
||
| 47 | |||
| 48 | /** |
||
| 49 | * Deletes the a given offset. |
||
| 50 | * |
||
| 51 | * @param mixed $offset the offset |
||
| 52 | * |
||
| 53 | * @return |
||
| 54 | */ |
||
| 55 | public function offsetUnset($offset) |
||
| 59 | |||
| 60 | /** |
||
| 61 | * Sets the value for a given offset. |
||
| 62 | * |
||
| 63 | * @param mixed $offset the offset |
||
| 64 | * @param mixed $value value for the offset |
||
| 65 | * |
||
| 66 | * @return |
||
| 67 | */ |
||
| 68 | public function offsetSet($offset, $value) |
||
| 72 | } |
||
| 73 |
This check marks access to variables or properties that have not been declared yet. While PHP has no explicit notion of declaring a variable, accessing it before a value is assigned to it is most likely a bug.