summaryrefslogtreecommitdiff
path: root/ext/spl/examples/cachingrecursiveiterator.inc
diff options
context:
space:
mode:
authorMarcus Boerger <helly@php.net>2003-12-07 15:03:11 +0000
committerMarcus Boerger <helly@php.net>2003-12-07 15:03:11 +0000
commit1765271499b3ab279b2d93ee2a8d62725a9ba6f8 (patch)
tree31b5b9ec971d23e425b50a4259b2528d7d772790 /ext/spl/examples/cachingrecursiveiterator.inc
parent8eb22d7b8d88e4897c7c469d6fb82ef58197cc21 (diff)
downloadphp-git-1765271499b3ab279b2d93ee2a8d62725a9ba6f8.tar.gz
Use a single bit field for the flags here
Diffstat (limited to 'ext/spl/examples/cachingrecursiveiterator.inc')
-rw-r--r--ext/spl/examples/cachingrecursiveiterator.inc11
1 files changed, 5 insertions, 6 deletions
diff --git a/ext/spl/examples/cachingrecursiveiterator.inc b/ext/spl/examples/cachingrecursiveiterator.inc
index 898d40b0bc..cc1f101d99 100644
--- a/ext/spl/examples/cachingrecursiveiterator.inc
+++ b/ext/spl/examples/cachingrecursiveiterator.inc
@@ -6,23 +6,22 @@ class CachingRecursiveIterator extends CachingIterator implements RecursiveItera
protected $getChildren;
protected $catch_get_child;
- function __construct(RecursiveIterator $it, $getStrVal = true, $catch_get_child = false)
+ function __construct(RecursiveIterator $it, $flags = CIT_GET_STR_VALUE)
{
- $this->catch_get_child = $catch_get_child;
- parent::__construct($it, $getStrVal);
+ parent::__construct($it, $flags);
}
function next()
{
if ($this->hasChildren = $this->it->hasChildren()) {
try {
- //$this->getChildren = new CachingRecursiveIterator($this->it->getChildren(), $this->getStrVal, $this->catch_get_child);
+ //$this->getChildren = new CachingRecursiveIterator($this->it->getChildren(), $this->flags);
// workaround memleaks...
$child = $this->it->getChildren();
- $this->getChildren = new CachingRecursiveIterator($child, $this->getStrVal, $this->catch_get_child);
+ $this->getChildren = new CachingRecursiveIterator($child, $this->flags);
}
catch(Exception $e) {
- if (!$this->catch_get_child) {
+ if (!$this->flags & CIT_CATCH_GET_CHILD) {
throw $e;
}
$this->hasChildren = false;