3v4l.org

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