Annotation of embedaddon/php/ext/reflection/tests/ReflectionClass_isIterateable_basic.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: ReflectionClass::isIterateable() basic
3: --CREDITS--
4: Felix De Vliegher <felix.devliegher@gmail.com>, Marc Veldman <marc@ibuildings.nl>
5: --FILE--
6: <?php
7:
8: class IteratorClass implements Iterator {
9: public function __construct() { }
10: public function key() {}
11: public function current() {}
12: function next() {}
13: function valid() {}
14: function rewind() {}
15: }
16: class DerivedClass extends IteratorClass {}
17: class NonIterator {}
18:
19: function dump_iterateable($class) {
20: $reflection = new ReflectionClass($class);
21: var_dump($reflection->isIterateable());
22: }
23:
24: $classes = array("ArrayObject", "IteratorClass", "DerivedClass", "NonIterator");
25: foreach ($classes as $class) {
26: echo "Is $class iterateable? ";
27: dump_iterateable($class);
28: }
29: ?>
30: --EXPECT--
31: Is ArrayObject iterateable? bool(true)
32: Is IteratorClass iterateable? bool(true)
33: Is DerivedClass iterateable? bool(true)
34: Is NonIterator iterateable? bool(false)
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>