Array class_implements (mixed $class [, BOOL $autoload])-Returns all interfaces implemented by the specified class.
Array class_parents (mixed $class [, BOOL $autoload])-Returns the parent class of the specified class. int iterator_apply (traversable $iterator, callable $function [, array $args])-Invokes a user-defined function for each element in the iterator
int Iterator_count (traversable $iterator)-Calculates the number of elements in an iterator
Array Iterator_to_array (traversable $iterator [, bool $use = True])-copies elements from an iterator to an array
Example:
<?php
Interface foo{}
class Bar implements foo{}
class Bar2 extends bar{}
//Return all interfaces
implemented by the specified class Print_r (new Bar ()) (class_implements);
Returns the parent class Print_r of the specified class
(class_parents (new bar2));
function _toupper (iterator $iterator) {
echo strtoupper ($iterator-> current (). " \ n ");
return TRUE;
}
$it = new Arrayiterator (Array ("A" => "Apples", "B" => "Bananas", "C" => "cherries"));
Invokes a user-defined function for each element in the iterator
iterator_apply ($it, "_toupper", Array ($it));
Calculates the number of elements in the iterator
$iterator _count = Iterator_count ($it);
Copies the elements in the iterator to the array
print_r (Iterator_to_array ($it, FALSE));
Returns all available SPL class
Print_r (Spl_classes ());