+
+ /**
+ * Returns the number of members in an xmlrpc value:
+ * - 0 for uninitialized values
+ * - 1 for scalars
+ * - the number of elements for structs and arrays
+ *
+ * @return integer
+ */
+ public function count()
+ {
+ switch ($this->mytype) {
+ case 3:
+ count($this->me['struct']);
+ case 2:
+ return count($this->me['array']);
+ case 1:
+ return 1;
+ default:
+ return 0;
+ }
+ }
+
+ /**
+ * Implements the IteratorAggregate interface
+ *
+ * @return ArrayIterator
+ */
+ public function getIterator() {
+ switch ($this->mytype) {
+ case 3:
+ return new \ArrayIterator($this->me['struct']);
+ case 2:
+ return new \ArrayIterator($this->me['array']);
+ case 1:
+ return new \ArrayIterator($this->me);
+ default:
+ return new \ArrayIterator();
+ }
+ return new \ArrayIterator();
+ }
+}
\ No newline at end of file