diff options
author | Mark A. Hershberger <mah@debian.(none)> | 2009-03-25 19:39:21 -0400 |
---|---|---|
committer | Mark A. Hershberger <mah@debian.(none)> | 2009-03-25 19:39:21 -0400 |
commit | 6821b67124604da690c5e9276d5370d679c63ac8 (patch) | |
tree | befb4ca2520eb577950cef6cb76d10b914cbf67a /ext/spl/examples/dualiterator.inc | |
parent | cd0b49c72aee33b3e44a9c589fcd93b9e1c7a64f (diff) | |
download | php-6821b67124604da690c5e9276d5370d679c63ac8.tar.gz |
Imported Upstream version 5.3.0RC1upstream/5.3.0_RC1upstream/5.3.0RC1
Diffstat (limited to 'ext/spl/examples/dualiterator.inc')
-rwxr-xr-x | ext/spl/examples/dualiterator.inc | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/ext/spl/examples/dualiterator.inc b/ext/spl/examples/dualiterator.inc index 9d14328d7..4cee20343 100755 --- a/ext/spl/examples/dualiterator.inc +++ b/ext/spl/examples/dualiterator.inc @@ -23,10 +23,9 @@ class DualIterator implements Iterator const KEY_LHS = 0x10; const KEY_RHS = 0x20; - const KEY_ARRAY = 0x30; const KEY_0 = 0x00; - const DEFAULT_FLAGS = 0x33; + const DEFAULT_FLAGS = 0x13; private $lhs; private $rhs; @@ -39,7 +38,7 @@ class DualIterator implements Iterator * @param flags iteration flags */ function __construct(Iterator $lhs, Iterator $rhs, - $flags = 0x33 /*DualIterator::DEFAULT_FLAGS*/) + $flags = 0x13 /*DualIterator::DEFAULT_FLAGS*/) { $this->lhs = $lhs; $this->rhs = $rhs; @@ -107,20 +106,18 @@ class DualIterator implements Iterator } } - /** @return current value depending on KEY_* flags + /** @return key value depending on KEY_* flags */ function key() { switch($this->flags & 0xF0) { default: - case self::CURRENT_ARRAY: - return array($this->lhs->key(), $this->rhs->key()); - case self::CURRENT_LHS: + case self::KEY_LHS: return $this->lhs->key(); - case self::CURRENT_RHS: + case self::KEY_RHS: return $this->rhs->key(); - case self::CURRENT_0: + case self::KEY_0: return NULL; } } |