From: Zeev Suraski Date: Sun, 4 Jul 1999 23:50:58 +0000 (+0000) Subject: Make convert_to_string() regard false as "" instead of "0" X-Git-Tag: BEFORE_REMOVING_GC_STEP1~25 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d189972737bd1197c3f6d71c39d561a5ddb9c898;p=php Make convert_to_string() regard false as "" instead of "0" --- diff --git a/Zend/zend_operators.c b/Zend/zend_operators.c index af0124ac5b..181d01eddf 100644 --- a/Zend/zend_operators.c +++ b/Zend/zend_operators.c @@ -287,8 +287,13 @@ ZEND_API void convert_to_string(zval *op) case IS_STRING: break; case IS_BOOL: - op->value.str.val = (op->value.lval?estrndup("1",1):estrndup("0",1)); - op->value.str.len = 1; + if (op->value.lval) { + op->value.str.val = estrndup("1", 1); + op->value.str.len = 1; + } else { + op->value.str.val = empty_string; + op->value.str.len = 0; + } break; case IS_LONG: lval = op->value.lval;