3v4l.org

run code in 300+ PHP versions simultaneously
<?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.

preferences:
195.67 ms | 1395 KiB | 61 Q