3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $variable = Array( [0] => Array( [id]=>"1" [file]=>"new" ) [1] => Array( [id]=>"2" [file]=>"sample" ) [2] => Array( [id]=>"3" [file]=>"new" ) [3] => Array( [id]=>"4" [file]=>"garden" ) [4] => Array( [id]=>"5" [file]=>"new" ) [5] => Array( [id]=>"6" [file]=>"tem" ) ); foreach($variable AS $item) { if($item['file'] == "new") $newarray[] = $item; } print_r($newarray);
Output for 5.3.0 - 5.4.24
Parse error: syntax error, unexpected '[', expecting ')' in /in/QBaA2 on line 3
Process exited with code 255.