3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $my_array = array( [0] => array( [country] => 'USA', [day] => '02', [month] => 'February', [mon] => '02', [year] => '2012'), [1] => array( [country] => 'Canada', [day] => '10', [month] => 'February', [mon] => '02', [year] => '2012') ); foreach($my_array as $array){ foreach($array as $c[country]){ if($c[country] == "USA"){ $my_array = $array[day]." ".$array[month]." ".$array[year]." (".$array[country].")"; break; } } } echo $my_array;
based on 91usr
Output for 7.0.0 - 7.1.0
Notice: Use of undefined constant country - assumed 'country' in /in/229sY on line 4 Warning: Illegal offset type in /in/229sY on line 4 Notice: Use of undefined constant day - assumed 'day' in /in/229sY on line 5 Warning: Illegal offset type in /in/229sY on line 5 Notice: Use of undefined constant month - assumed 'month' in /in/229sY on line 6 Warning: Illegal offset type in /in/229sY on line 6 Notice: Use of undefined constant mon - assumed 'mon' in /in/229sY on line 7 Warning: Illegal offset type in /in/229sY on line 7 Notice: Use of undefined constant year - assumed 'year' in /in/229sY on line 8 Warning: Illegal offset type in /in/229sY on line 8 Warning: Illegal offset type in /in/229sY on line 8 Notice: Use of undefined constant country - assumed 'country' in /in/229sY on line 10 Warning: Illegal offset type in /in/229sY on line 10 Notice: Use of undefined constant day - assumed 'day' in /in/229sY on line 11 Warning: Illegal offset type in /in/229sY on line 11 Notice: Use of undefined constant month - assumed 'month' in /in/229sY on line 12 Warning: Illegal offset type in /in/229sY on line 12 Notice: Use of undefined constant mon - assumed 'mon' in /in/229sY on line 13 Warning: Illegal offset type in /in/229sY on line 13 Notice: Use of undefined constant year - assumed 'year' in /in/229sY on line 14 Warning: Illegal offset type in /in/229sY on line 14 Warning: Illegal offset type in /in/229sY on line 14 Notice: Array to string conversion in /in/229sY on line 27 Array
Output for 5.4.0 - 5.6.28
Notice: Use of undefined constant country - assumed 'country' in /in/229sY on line 4 Warning: Illegal offset type in /in/229sY on line 4 Notice: Use of undefined constant day - assumed 'day' in /in/229sY on line 5 Warning: Illegal offset type in /in/229sY on line 5 Notice: Use of undefined constant month - assumed 'month' in /in/229sY on line 6 Warning: Illegal offset type in /in/229sY on line 6 Notice: Use of undefined constant mon - assumed 'mon' in /in/229sY on line 7 Warning: Illegal offset type in /in/229sY on line 7 Notice: Use of undefined constant year - assumed 'year' in /in/229sY on line 8 Warning: Illegal offset type in /in/229sY on line 8 Warning: Illegal offset type in /in/229sY on line 8 Notice: Use of undefined constant country - assumed 'country' in /in/229sY on line 10 Warning: Illegal offset type in /in/229sY on line 10 Notice: Use of undefined constant day - assumed 'day' in /in/229sY on line 11 Warning: Illegal offset type in /in/229sY on line 11 Notice: Use of undefined constant month - assumed 'month' in /in/229sY on line 12 Warning: Illegal offset type in /in/229sY on line 12 Notice: Use of undefined constant mon - assumed 'mon' in /in/229sY on line 13 Warning: Illegal offset type in /in/229sY on line 13 Notice: Use of undefined constant year - assumed 'year' in /in/229sY on line 14 Warning: Illegal offset type in /in/229sY on line 14 Warning: Illegal offset type in /in/229sY on line 15 Notice: Array to string conversion in /in/229sY on line 27 Array
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.3.29
Parse error: syntax error, unexpected '[', expecting ')' in /in/229sY on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected '[', expecting ')' in /in/229sY on line 3
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `')'' in /in/229sY on line 3
Process exited with code 255.