summaryrefslogtreecommitdiff
path: root/Zend/zend_operators.c
diff options
context:
space:
mode:
Diffstat (limited to 'Zend/zend_operators.c')
-rw-r--r--Zend/zend_operators.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/Zend/zend_operators.c b/Zend/zend_operators.c
index b112a50257..6a4402a935 100644
--- a/Zend/zend_operators.c
+++ b/Zend/zend_operators.c
@@ -1339,6 +1339,13 @@ static void increment_string(zval *str)
int last=0; /* Shut up the compiler warning */
int ch;
+ if (str->value.str.len == 0) {
+ STR_FREE(str->value.str.val);
+ str->value.str.val = estrndup("1", sizeof("1")-1);
+ str->value.str.len = 1;
+ return;
+ }
+
while(pos >= 0) {
ch = s[pos];
if (ch >= 'a' && ch <= 'z') {