Hello internals,
Could anyone who can commit to CVS review this patch and commit it if it's OK?
The patch was made for php5-200401021030 snapshot, the file
zend_object_handlers.c. It fixes the bug that using $a[] = 'Something' where
$a is instance of ArrayAccess will invoke offsetSet() with empty offset.
403c403
< zval tmp;
---
> zval *exists;
407,408c407,416
< INIT_ZVAL(tmp);
< offset = &tmp;
---
> MAKE_STD_ZVAL( offset );
> ZVAL_LONG( offset, 0 );
>
> MAKE_STD_ZVAL( exists );
> zend_call_method_with_1_params( &object, ce, NULL, "offsetexists", &exists, offset );
> while( exists->type != IS_BOOL || exists->value.lval != 0 )
> {
> offset->value.lval++;
> zend_call_method_with_1_params( &object, ce, NULL, "offsetexists", &exists, offset );
> }
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php