TestExtOptions, TestExtNetwork, TestExtSocket -> php
[hiphop-php.git] / hphp / test / slow / array_object / setIteratorClass.php
blob0c5f04a1269a2372376e34cf3e8b290c2be20fc7
1 <?php
3 // Custom ArrayIterator (inherits from ArrayIterator)
4 class MyArrayIterator extends ArrayIterator {
5 // custom implementation
8 // Array of available fruits
9 $fruits = array("lemons" => 1, "oranges" => 4, "bananas" => 5, "apples" => 10);
11 $fruitsArrayObject = new ArrayObject($fruits);
13 // Set the iterator classname to the newly
14 $fruitsArrayObject->setIteratorClass('MyArrayIterator');
15 print_r($fruitsArrayObject->getIterator());