summaryrefslogtreecommitdiff
path: root/ext/standard/basic_functions.c
diff options
context:
space:
mode:
authorAndrey Hristov <andrey@php.net>1999-06-09 21:13:05 +0000
committerAndrey Hristov <andrey@php.net>1999-06-09 21:13:05 +0000
commit3d45dd58b87b847271bdf483f7ead1db5465f86d (patch)
treec0ccb94cfaa59c5257b08b9e91b9c4f3846d3a7a /ext/standard/basic_functions.c
parentb484f40c31612212d20cea69e0c0d8fa204f4e8a (diff)
downloadphp-git-3d45dd58b87b847271bdf483f7ead1db5465f86d.tar.gz
Fixed a bug in preg_split.
Fixed a bug in array_shift/array_pop.
Diffstat (limited to 'ext/standard/basic_functions.c')
-rw-r--r--ext/standard/basic_functions.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c
index e37fcbc741..43bc22b0c3 100644
--- a/ext/standard/basic_functions.c
+++ b/ext/standard/basic_functions.c
@@ -2583,7 +2583,11 @@ static void _phpi_pop(INTERNAL_FUNCTION_PARAMETERS, int off_the_end)
zend_error(E_WARNING, "The argument needs to be an array");
return;
}
-
+
+ if (zend_hash_num_elements(stack->value.ht) == 0) {
+ return;
+ }
+
/* Get the first or last value and copy it into the return value */
if (off_the_end)
zend_hash_internal_pointer_end(stack->value.ht);