SPL-StandardPHPLibrary
recursivearrayiterator.inc
Go to the documentation of this file.
1 <?php
2 
31 {
34  function hasChildren()
35  {
36  return is_array($this->current());
37  }
38 
43  function getChildren()
44  {
45  if ($this->current() instanceof self)
46  {
47  return $this->current();
48  }
49  if (empty($this->ref))
50  {
51  $this->ref = new ReflectionClass($this);
52  }
53  return $this->ref->newInstance($this->current());
54  }
55 
56  private $ref;
57 }
58 
59 ?>
Interface for recursive iteration with RecursiveIteratorIterator.
A recursive array iterator.
An Array iterator.
Definition: spl.php:741
current()
Return the current element.
Definition: spl.php:843