Re: cvs: php-src /ext/spl spl_array.c

From: Date: Thu, 29 Apr 2004 07:23:01 +0000
Subject: Re: cvs: php-src /ext/spl spl_array.c
References: 1 2  Groups: php.cvs 
Request: Send a blank email to php-cvs+get-27218@lists.php.net to get a copy of this message
Hello Jon, Thursday, April 29, 2004, 12:19:50 AM, you wrote: > On Wed, Apr 28, 2004 at 09:45:41PM -0000, Marcus Boerger wrote: >> +/* {{{ proto bool ArrayObject::count() >> + Return the number of elements in the Iterator. */ >> +SPL_METHOD(Array, count) >> +{ >> + long position; >> + zval *object = getThis(); >> + spl_array_object *intern = >> (spl_array_object*)zend_object_store_get_object(object TSRMLS_CC); >> + HashTable *aht = HASH_OF(intern->array); >> + HashPosition pos; >> + >> + if (!aht) { >> + php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Array was modified >> outside object and is no longer an array"); >> + RETURN_LONG(0); >> + } >> + >> + RETURN_LONG(zend_hash_num_elements(aht)); >> +} /* }}} */ >> + >> /* {{{ proto mixed|NULL ArrayIterator::current() >> Return current array entry */ >> SPL_METHOD(Array, current) > It looks like both 'long position' and 'HashPosition pos' are unused > in this function. Thanks, that also showed me i have to respect visibility there. marcus

« previous php.cvs (#27218) next »