helly Tue May 18 16:39:35 2004 EDT
Modified files:
/php-src/ext/spl spl_iterators.c
Log:
- Make start and length parameter to Limititerator::__construct optional
http://cvs.php.net/diff.php/php-src/ext/spl/spl_iterators.c?r1=1.35&r2=1.36&ty=u
Index: php-src/ext/spl/spl_iterators.c
diff -u php-src/ext/spl/spl_iterators.c:1.35 php-src/ext/spl/spl_iterators.c:1.36
--- php-src/ext/spl/spl_iterators.c:1.35 Thu May 6 05:01:31 2004
+++ php-src/ext/spl/spl_iterators.c Tue May 18 16:39:35 2004
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: spl_iterators.c,v 1.35 2004/05/06 09:01:31 helly Exp $ */
+/* $Id: spl_iterators.c,v 1.36 2004/05/18 20:39:35 helly Exp $ */
#ifdef HAVE_CONFIG_H
# include "config.h"
@@ -563,8 +563,9 @@
intern->dit_type = dit_type;
switch (dit_type) {
case DIT_LimitIterator: {
+ intern->u.limit.offset = 0; /* start at beginning */
intern->u.limit.count = -1; /* get all */
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Ol|l",
&zobject, ce_inner, &intern->u.limit.offset, &intern->u.limit.count) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O|ll",
&zobject, ce_inner, &intern->u.limit.offset, &intern->u.limit.count) == FAILURE) {
php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC);
return NULL;
}
@@ -984,7 +985,7 @@
}
}
-/* {{{ proto LimitIterator:__construct(Iterator $it, int $offset [, int $count])
+/* {{{ proto LimitIterator:__construct(Iterator $it [, int $offset, int $count])
Construct a LimitIterator from an Iterator with a given starting offset and
optionally a maximum count */
SPL_METHOD(LimitIterator, __construct)
{
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php