From: Andi Gutmans Date: Wed, 14 Jul 1999 09:10:14 +0000 (+0000) Subject: - Fix for boolean convert to number X-Git-Tag: php-4.0b1~143 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=078c3ce198a6a1f6ee244b4e4d155e935360cc19;p=php - Fix for boolean convert to number --- diff --git a/Zend/zend_operators.c b/Zend/zend_operators.c index 38963c8c61..d0d9e2cc34 100644 --- a/Zend/zend_operators.c +++ b/Zend/zend_operators.c @@ -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); \ }