3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function rec($arr, $callRec = true) { foreach ($arr as $a) { var_dump($a, $callRec); if ($callRec) { rec($arr, false); } } } $array = range(1,5); rec($array, true);
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
int(1) bool(true) int(1) bool(false) int(2) bool(false) int(3) bool(false) int(4) bool(false) int(5) bool(false) int(2) bool(true) int(1) bool(false) int(2) bool(false) int(3) bool(false) int(4) bool(false) int(5) bool(false) int(3) bool(true) int(1) bool(false) int(2) bool(false) int(3) bool(false) int(4) bool(false) int(5) bool(false) int(4) bool(true) int(1) bool(false) int(2) bool(false) int(3) bool(false) int(4) bool(false) int(5) bool(false) int(5) bool(true) int(1) bool(false) int(2) bool(false) int(3) bool(false) int(4) bool(false) int(5) bool(false)