Yes there is.
Firstly, the unset() parameter will only work for adjacent numeric arrays. If your array contains elements that are not numerical or have any spaces in its numerical sequence, then the unset() call will get the wrong value from count() and fail.
Secondly, if your array is numeric and contiguous, there is still a difference:
array_pop() will also return the value of the popup element as the return value. unset() will not do this.
So, if you need to continue to use data, use array_pop() .
If you don’t need to save the value, then no, it’s probably not too important which one you use, I suspect array_pop() may be faster (due to the fact that you do not need to call count() ), but I don’t checked, and, frankly, if you do not make thousands of calls, the difference will be negligible.
source share