Fix array_pop

Code:
$var = ['AAAAA'];
array_pop($var);

Error:
java.lang.ArrayIndexOutOfBoundsException: -1