brentimus' array_set_pointer function will only work if the array value is unique in the array, and none of the array values are FALSE. It would be more reliable to use key() instead of current(). For similar reasons it's better to check key() after calling next() to determine whether the next() element "exists". Simply checking the value returned by next() will produce a false negative when looking at, for example, the first element of the array: ['one', 0, 'three']
However, it also turns out that the copied array retains the original array's pointer, so array_set_pointer is not actually required here. The following should work:
<?php
function has_next(array &$array) {
$A_work = $array; next($A_work);
if (key($A_work) === NULL)
return false;
else
return true;
}
?>