diff --git a/generated/array.php b/generated/array.php index 80c90ff8..eef5d79e 100644 --- a/generated/array.php +++ b/generated/array.php @@ -462,3 +462,108 @@ function usort(array &$array, callable $value_compare_func): void throw ArrayException::createFromPhpError(); } } + + +/** + * This function will return the current element in an array. + * + * @param object|array $array The input array. + * + * @return mixed + * @throws ArrayException + * + */ +function current($array) +{ + error_clear_last(); + $result = \current($array); + if ($result === false) { + throw ArrayException::createFromPhpError(); + } + + return $result; +} + + +/** + * This function will set the internal pointer of an array to its last element. + * + * @param object|array &$array The input array. + * + * @return mixed + * @throws ArrayException + * + */ +function end(&$array) +{ + error_clear_last(); + $result = \end($array); + if ($result === false) { + throw ArrayException::createFromPhpError(); + } + + return $result; +} + + +/** + * This function will advance the internal pointer of an array. + * + * @param object|array &$array The input array. + * + * @return mixed + * @throws ArrayException + * + */ +function next(&$array) +{ + error_clear_last(); + $result = \next($array); + if ($result === false) { + throw ArrayException::createFromPhpError(); + } + + return $result; +} + + +/** + * This function will rewind the internal array pointer. + * + * @param object|array &$array The input array. + * + * @return mixed + * @throws ArrayException + * + */ +function prev(&$array) +{ + error_clear_last(); + $result = \prev($array); + if ($result === false) { + throw ArrayException::createFromPhpError(); + } + + return $result; +} + + +/** + * This function will set the internal pointer of an array to its first element. + * + * @param object|array &$array The input array. + * + * @return mixed + * @throws ArrayException + * + */ +function reset(&$array) +{ + error_clear_last(); + $result = \reset($array); + if ($result === false) { + throw ArrayException::createFromPhpError(); + } + + return $result; +}