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;
Output for 7.0.0 - 7.1.0
Notice: Use of undefined constant country - assumed 'country' in /in/8KjfI on line 5 Warning: Illegal offset type in /in/8KjfI on line 5 Notice: Use of undefined constant day - assumed 'day' in /in/8KjfI on line 6 Warning: Illegal offset type in /in/8KjfI on line 6 Notice: Use of undefined constant month - assumed 'month' in /in/8KjfI on line 7 Warning: Illegal offset type in /in/8KjfI on line 7 Notice: Use of undefined constant mon - assumed 'mon' in /in/8KjfI on line 8 Warning: Illegal offset type in /in/8KjfI on line 8 Notice: Use of undefined constant year - assumed 'year' in /in/8KjfI on line 9 Warning: Illegal offset type in /in/8KjfI on line 9 Warning: Illegal offset type in /in/8KjfI on line 9 Notice: Use of undefined constant country - assumed 'country' in /in/8KjfI on line 13 Warning: Illegal offset type in /in/8KjfI on line 13 Notice: Use of undefined constant day - assumed 'day' in /in/8KjfI on line 14 Warning: Illegal offset type in /in/8KjfI on line 14 Notice: Use of undefined constant month - assumed 'month' in /in/8KjfI on line 15 Warning: Illegal offset type in /in/8KjfI on line 15 Notice: Use of undefined constant mon - assumed 'mon' in /in/8KjfI on line 16 Warning: Illegal offset type in /in/8KjfI on line 16 Notice: Use of undefined constant year - assumed 'year' in /in/8KjfI on line 17 Warning: Illegal offset type in /in/8KjfI on line 17 Warning: Illegal offset type in /in/8KjfI on line 17 Notice: Array to string conversion in /in/8KjfI on line 30 Array
Output for 5.4.0 - 5.6.28
Notice: Use of undefined constant country - assumed 'country' in /in/8KjfI on line 5 Warning: Illegal offset type in /in/8KjfI on line 5 Notice: Use of undefined constant day - assumed 'day' in /in/8KjfI on line 6 Warning: Illegal offset type in /in/8KjfI on line 6 Notice: Use of undefined constant month - assumed 'month' in /in/8KjfI on line 7 Warning: Illegal offset type in /in/8KjfI on line 7 Notice: Use of undefined constant mon - assumed 'mon' in /in/8KjfI on line 8 Warning: Illegal offset type in /in/8KjfI on line 8 Notice: Use of undefined constant year - assumed 'year' in /in/8KjfI on line 9 Warning: Illegal offset type in /in/8KjfI on line 10 Warning: Illegal offset type in /in/8KjfI on line 10 Notice: Use of undefined constant country - assumed 'country' in /in/8KjfI on line 13 Warning: Illegal offset type in /in/8KjfI on line 13 Notice: Use of undefined constant day - assumed 'day' in /in/8KjfI on line 14 Warning: Illegal offset type in /in/8KjfI on line 14 Notice: Use of undefined constant month - assumed 'month' in /in/8KjfI on line 15 Warning: Illegal offset type in /in/8KjfI on line 15 Notice: Use of undefined constant mon - assumed 'mon' in /in/8KjfI on line 16 Warning: Illegal offset type in /in/8KjfI on line 16 Notice: Use of undefined constant year - assumed 'year' in /in/8KjfI on line 17 Warning: Illegal offset type in /in/8KjfI on line 18 Warning: Illegal offset type in /in/8KjfI on line 19 Notice: Array to string conversion in /in/8KjfI on line 30 Array
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.3.29
Parse error: syntax error, unexpected '[', expecting ')' in /in/8KjfI 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/8KjfI on line 3
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `')'' in /in/8KjfI on line 3
Process exited with code 255.