| 1 | <?php |
||
| 18 | class Arrays |
||
| 19 | { |
||
| 20 | /** |
||
| 21 | * Create an empty array containing a specific number of elements |
||
| 22 | * |
||
| 23 | * @param int $numElements The number of elements in Array |
||
| 24 | * @return array |
||
| 25 | */ |
||
| 26 | 1 | public static function createEmptyArray($numElements):ArrayObject |
|
| 30 | |||
| 31 | /** |
||
| 32 | * Check whether a key exists in array and corresponding value is not empty |
||
| 33 | * |
||
| 34 | * @param array $array |
||
| 35 | * @param mixed $element |
||
| 36 | * @return bool |
||
| 37 | */ |
||
| 38 | 20 | public static function hasElement(array $array, $element):bool |
|
| 42 | } |
||
| 43 |