summaryrefslogtreecommitdiff
path: root/ext/standard/string.c
diff options
context:
space:
mode:
authorBrian Shire <shire@php.net>2008-12-27 05:15:51 +0000
committerBrian Shire <shire@php.net>2008-12-27 05:15:51 +0000
commitb4141cc424579f0668ac760c60d9e5938f1a4c41 (patch)
treebe85c128edc02131da789b94feca799caa6df605 /ext/standard/string.c
parent2dd8d6ff947e77383c5159753dfee37ce7b8b3d3 (diff)
downloadphp-git-b4141cc424579f0668ac760c60d9e5938f1a4c41.tar.gz
MFH: fix explode behavior to respect negative limit when string is empty.
Diffstat (limited to 'ext/standard/string.c')
-rw-r--r--ext/standard/string.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/ext/standard/string.c b/ext/standard/string.c
index d3a6fdffd8..8e85045f66 100644
--- a/ext/standard/string.c
+++ b/ext/standard/string.c
@@ -1018,7 +1018,9 @@ PHP_FUNCTION(explode)
array_init(return_value);
if (! Z_STRLEN_PP(str)) {
- add_next_index_stringl(return_value, "", sizeof("") - 1, 1);
+ if (limit >= 0 || argc == 2) {
+ add_next_index_stringl(return_value, "", sizeof("") - 1, 1);
+ }
return;
}