From: Dmitry Stogov Date: Mon, 6 Jun 2005 08:25:22 +0000 (+0000) Subject: Added test for bug #32993 (implemented Iterator function current() don't throw X-Git-Tag: php-5.0.5RC1~208 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=52cd8053dc9f116e80703f0a18e4353ee1cf549a;p=php Added test for bug #32993 (implemented Iterator function current() don't throw exception) --- diff --git a/Zend/tests/bug32993.phpt b/Zend/tests/bug32993.phpt new file mode 100755 index 0000000000..88fb0230b6 --- /dev/null +++ b/Zend/tests/bug32993.phpt @@ -0,0 +1,29 @@ +--TEST-- +Bug #32993 (implemented Iterator function current() don't throw exception) +--FILE-- +arr); } + public function current() { throw new Exception(); } + public function key() { return key($this->arr); } + public function next() { return next($this->arr); } + public function valid() { return (current($this->arr) !== false); } +} + +$t = new Test(); +$t->arr = array(1, 2, 3); + +try { + foreach ($t as $v) { + echo "$v\n"; + } +} catch (Exception $e) { + ; // handle exception +} +echo "ok\n"; +?> +--EXPECT-- +ok