helly Sun May 2 18:07:33 2004 EDT
Modified files:
/php-src/ext/spl/examples cachingiterator.inc
cachingrecursiveiterator.inc
Log:
Update examples
http://cvs.php.net/diff.php/php-src/ext/spl/examples/cachingiterator.inc?r1=1.7&r2=1.8&ty=u
Index: php-src/ext/spl/examples/cachingiterator.inc
diff -u php-src/ext/spl/examples/cachingiterator.inc:1.7
php-src/ext/spl/examples/cachingiterator.inc:1.8
--- php-src/ext/spl/examples/cachingiterator.inc:1.7 Mon Mar 8 12:33:30 2004
+++ php-src/ext/spl/examples/cachingiterator.inc Sun May 2 18:07:32 2004
@@ -8,14 +8,14 @@
protected $it;
protected $current;
protected $key;
- protected $more;
+ protected $valid;
protected $strValue;
- protected $getStrVal;
function __construct(Iterator $it, $flags = CIT_CALL_TOSTRING)
{
$this->it = $it;
$this->flags = $flags & (CIT_CALL_TOSTRING|CIT_CATCH_GET_CHILD);
+ $this->next();
}
function rewind()
@@ -26,7 +26,7 @@
function next()
{
- if ($this->more = $this->it->valid()) {
+ if ($this->valid = $this->it->valid()) {
$this->current = $this->it->current();
$this->key = $this->it->key();
if ($this->flags & CIT_CALL_TOSTRING) {
@@ -46,7 +46,7 @@
function valid()
{
- return $this->more;
+ return $this->valid;
}
function hasNext()
http://cvs.php.net/diff.php/php-src/ext/spl/examples/cachingrecursiveiterator.inc?r1=1.6&r2=1.7&ty=u
Index: php-src/ext/spl/examples/cachingrecursiveiterator.inc
diff -u php-src/ext/spl/examples/cachingrecursiveiterator.inc:1.6
php-src/ext/spl/examples/cachingrecursiveiterator.inc:1.7
--- php-src/ext/spl/examples/cachingrecursiveiterator.inc:1.6 Mon Dec 8 03:31:08
2003
+++ php-src/ext/spl/examples/cachingrecursiveiterator.inc Sun May 2 18:07:32
2004
@@ -4,13 +4,19 @@
{
protected $hasChildren;
protected $getChildren;
- protected $catch_get_child;
function __construct(RecursiveIterator $it, $flags = CIT_CALL_TOSTRING)
{
parent::__construct($it, $flags);
}
+ function rewind();
+ {
+ $this->hasChildren = false;
+ $this->getChildren = NULL;
+ parent::rewind();
+ }
+
function next()
{
if ($this->hasChildren = $this->it->hasChildren()) {
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php