Re: [ZEND-ENGINE-CVS] cvs: ZendEngine2 / zend_execute.c
| From: | Andrey Hristov | Date: | Wed, 22 Jan 2003 15:11:10 +0000 |
| Subject: | Re: [ZEND-ENGINE-CVS] cvs: ZendEngine2 / zend_execute.c | ||
| References: | 1 | Groups: | php.zend-engine.cvs |
| Request: | Send a blank email to php-zend-engine-cvs+get-839@lists.php.net to get a copy of this message | ||
I see that the bool it is intpreted as long, so the keys will be strings
and ints.
This fixes :
$arr = array(false => 'bar'); // array()
But is this the desired behavior that the man that reported the bug wanted?
In fact
print $arr[false]; // bar
is not different from :
print $arr[(int)false]; // bar
Andrey
----- Original Message -----
From: "Ilia Alshanetsky" <ilia@prohost.org>
To: <zend-engine-cvs@lists.php.net>
Sent: Wednesday, January 22, 2003 4:48 PM
Subject: [ZEND-ENGINE-CVS] cvs: ZendEngine2 / zend_execute.c
> iliaa Wed Jan 22 09:48:30 2003 EDT
>
> Modified files:
> /ZendEngine2 zend_execute.c
> Log:
> Fixed bug #21814 (Allow booleans to be used as array keys).
>
>
> Index: ZendEngine2/zend_execute.c
> diff -u ZendEngine2/zend_execute.c:1.410 ZendEngine2/zend_execute.c:1.411
> --- ZendEngine2/zend_execute.c:1.410 Wed Jan 15 19:44:17 2003
> +++ ZendEngine2/zend_execute.c Wed Jan 22 09:48:30 2003
> @@ -3172,6 +3172,7 @@
> zend_hash_index_update(array_ptr->value.ht, (long) offset->value.dval,
&expr_ptr, sizeof(zval *), NULL);
> break;
> case IS_LONG:
> + case IS_BOOL:
> zend_hash_index_update(array_ptr->value.ht, offset->value.lval,
&expr_ptr, sizeof(zval *), NULL);
> break;
> case IS_STRING:
>
>
>
> --
> Zend Engine CVS Mailing List (http://cvs.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>