Pops and returns the last value of the array, shortening the
array by one element.
If there are no elements in the array then 0 is returned otherwise
an array is returned where the first returned element is the popped
value, and the second element is the modified array.