]> granicus.if.org Git - php/commitdiff
- Change var_reset() to set bool(0) instead of string("")
authorZeev Suraski <zeev@php.net>
Wed, 29 Dec 1999 17:29:26 +0000 (17:29 +0000)
committerZeev Suraski <zeev@php.net>
Wed, 29 Dec 1999 17:29:26 +0000 (17:29 +0000)
Authors should go over their code and change it to use var_reset() instead of manually
setting it to string(""), in case they're interested in the false value.

Zend/zend_variables.c

index c0fee24ee66eedddb984bf6d88141e276475b841..f2cb9a138877f01bc8feabac5ceef6094ff4ef38 100644 (file)
@@ -38,9 +38,14 @@ ZEND_API char *undefined_variable_string = "\0";
 /* and empty strings must be evaluated as FALSE */
 ZEND_API inline void var_reset(zval *var)
 {
+#if 0
        var->type = IS_STRING;
        var->value.str.val = empty_string;
        var->value.str.len = 0;
+#else
+       var->type = IS_BOOL;
+       var->value.lval = 0;
+#endif
 }
 
 ZEND_API inline void var_uninit(zval *var)