]> granicus.if.org Git - php/commitdiff
- Fix for boolean convert to number
authorAndi Gutmans <andi@php.net>
Wed, 14 Jul 1999 09:10:14 +0000 (09:10 +0000)
committerAndi Gutmans <andi@php.net>
Wed, 14 Jul 1999 09:10:14 +0000 (09:10 +0000)
Zend/zend_operators.c

index 38963c8c61128207d1279929b8f9ea83c1bd9d12..d0d9e2cc3407cb24b7f1e3f70c02acb69083ca67 100644 (file)
@@ -41,6 +41,9 @@ ZEND_API void convert_scalar_to_number(zval *op)
                        case IS_DOUBLE:
                        case IS_LONG:
                                break;
+                       case IS_BOOL:
+                               op->type = IS_LONG;
+                               break;
 #if WITH_BCMATH
                        case IS_BC:
                                op->type = IS_DOUBLE; /* may have lost significant digits */
@@ -73,6 +76,7 @@ ZEND_API void convert_scalar_to_number(zval *op)
                } \
                (op) = &(holder); \
        } else if ((op)->type==IS_BOOL || (op)->type==IS_RESOURCE) { \
+               (holder) = *(op); \
                (holder).type = IS_LONG; \
                (op) = &(holder); \
        }