Introduction
These PHP 5.1 functions are to help handle Iterators.
There is no current information on the speed benchmarks of these functions compared to userland functions. These functions are C implementations, so one could assume they would be quicker.
Iterator Count
Counts the elements in any Iterator. Clones the Countable interface functionality for Iterators that don’t implement Countable.
$array = array('key1' => 'value1', 'key2' => 'value2');
echo iterator_count(new ArrayIterator($array));
Iterator To Array
Copies an Iterator to an array.
$array = array('key1' => 'value1', 'key2' => 'value2');
$newarray = iterator_to_array(new ArrayIterator($array));
Possibly Related Posts:
- Bullet: E-Book Library Management and Content Server
- Using ZendFramework 2 beta1 For Directory Project
- The Way of Kings and Cosmere Theory
- “In Time” Movie Premise Flawed
- Completing HTTP Library For PHP
Comments are closed.