3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function array_values_recursive($ary) { $lst = array(); foreach( array_keys($ary) as $k ){ $v = $ary[$k]; if (is_scalar($v)) { $lst[] = $v; } elseif (is_array($v)) { $lst = array_merge( $lst, array_values_recursive($v) ); } } return $lst; } $arra = array("a", "b", "c", "d"); print_r(array_values_recursive($arra));
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
Array ( [0] => a [1] => b [2] => c [3] => d )