3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $afr = function(&$v) use (&$afr) { if (is_array($v)) { foreach($v as $key=>$val) { if (empty($v)) unset($v[$key]); if is_array($v) $v = $afr($v); } } return $v; }; $a = ['',['',['a', 'b'],'c'],'d']; $b = $a; var_dump($afr($b)); ?><hr><?php var_dump($a);
Output for 5.4.0 - 5.4.29
Parse error: syntax error, unexpected 'is_array' (T_STRING), expecting '(' in /in/X2gvc on line 10
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected T_STRING, expecting '(' in /in/X2gvc on line 10
Process exited with code 255.