diff options
| author | Zeev Suraski <zeev@php.net> | 1999-07-04 23:50:58 +0000 |
|---|---|---|
| committer | Zeev Suraski <zeev@php.net> | 1999-07-04 23:50:58 +0000 |
| commit | d189972737bd1197c3f6d71c39d561a5ddb9c898 (patch) | |
| tree | 8ed21959606d1659fd6f691828b401f71dd6ebcb /Zend/zend_operators.c | |
| parent | 745c5efc37b8a9ea0b67ce373731099b3ef5fc3b (diff) | |
| download | php-git-d189972737bd1197c3f6d71c39d561a5ddb9c898.tar.gz | |
Make convert_to_string() regard false as "" instead of "0"
Diffstat (limited to 'Zend/zend_operators.c')
| -rw-r--r-- | Zend/zend_operators.c | 9 |
1 files changed, 7 insertions, 2 deletions
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; |
