3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a=array ( 'v' => array ( 0 => array ( 0 => 'v0_0', 1 => 'v0_1', 2 => 'v0_2', ), 1 => array ( 0 => 'v1_0', 1 => 'v1_1', 2 => 'v1_2', ), 2 => array ( 0 => 'v2_0', 1 => 'v2_1', 2 => 'v2_2', ), ), ); $it = new RecursiveIteratorIterator(new RecursiveArrayIterator($a)); echo count(iterator_to_array( $it, true));

preferences:
44.35 ms | 402 KiB | 5 Q