3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $opel= array( key => "vectra", key2 => 1999, key3 => 4, key4 => "green", ); $dodge= array( key => "DODGE CHALLENGER GT ALL-WHEEL DRIVE", key2 => 2017, key3 => 2, key4 => "rad", ); $mercmaybach= array( key => "Mercedes-Maybach S600", key2 => 2017, key3 => 4, key4 => "black" ); $arr=array($opel,$dodge,$mercmaybach); foreach ($arr as $value) { print_r($value); echo"<br>"; } ?>
Output for 7.2.0 - 7.3.0rc3
Warning: Use of undefined constant key - assumed 'key' (this will throw an Error in a future version of PHP) in /in/VILgt on line 3 Warning: Use of undefined constant key2 - assumed 'key2' (this will throw an Error in a future version of PHP) in /in/VILgt on line 4 Warning: Use of undefined constant key3 - assumed 'key3' (this will throw an Error in a future version of PHP) in /in/VILgt on line 5 Warning: Use of undefined constant key4 - assumed 'key4' (this will throw an Error in a future version of PHP) in /in/VILgt on line 6 Warning: Use of undefined constant key - assumed 'key' (this will throw an Error in a future version of PHP) in /in/VILgt on line 9 Warning: Use of undefined constant key2 - assumed 'key2' (this will throw an Error in a future version of PHP) in /in/VILgt on line 10 Warning: Use of undefined constant key3 - assumed 'key3' (this will throw an Error in a future version of PHP) in /in/VILgt on line 11 Warning: Use of undefined constant key4 - assumed 'key4' (this will throw an Error in a future version of PHP) in /in/VILgt on line 12 Warning: Use of undefined constant key - assumed 'key' (this will throw an Error in a future version of PHP) in /in/VILgt on line 15 Warning: Use of undefined constant key2 - assumed 'key2' (this will throw an Error in a future version of PHP) in /in/VILgt on line 16 Warning: Use of undefined constant key3 - assumed 'key3' (this will throw an Error in a future version of PHP) in /in/VILgt on line 17 Warning: Use of undefined constant key4 - assumed 'key4' (this will throw an Error in a future version of PHP) in /in/VILgt on line 18 Array ( [key] => vectra [key2] => 1999 [key3] => 4 [key4] => green ) <br>Array ( [key] => DODGE CHALLENGER GT ALL-WHEEL DRIVE [key2] => 2017 [key3] => 2 [key4] => rad ) <br>Array ( [key] => Mercedes-Maybach S600 [key2] => 2017 [key3] => 4 [key4] => black ) <br>
Output for 5.6.0 - 5.6.30, hhvm-3.15.4, 7.0.0 - 7.1.20
Notice: Use of undefined constant key - assumed 'key' in /in/VILgt on line 3 Notice: Use of undefined constant key2 - assumed 'key2' in /in/VILgt on line 4 Notice: Use of undefined constant key3 - assumed 'key3' in /in/VILgt on line 5 Notice: Use of undefined constant key4 - assumed 'key4' in /in/VILgt on line 6 Notice: Use of undefined constant key - assumed 'key' in /in/VILgt on line 9 Notice: Use of undefined constant key2 - assumed 'key2' in /in/VILgt on line 10 Notice: Use of undefined constant key3 - assumed 'key3' in /in/VILgt on line 11 Notice: Use of undefined constant key4 - assumed 'key4' in /in/VILgt on line 12 Notice: Use of undefined constant key - assumed 'key' in /in/VILgt on line 15 Notice: Use of undefined constant key2 - assumed 'key2' in /in/VILgt on line 16 Notice: Use of undefined constant key3 - assumed 'key3' in /in/VILgt on line 17 Notice: Use of undefined constant key4 - assumed 'key4' in /in/VILgt on line 18 Array ( [key] => vectra [key2] => 1999 [key3] => 4 [key4] => green ) <br>Array ( [key] => DODGE CHALLENGER GT ALL-WHEEL DRIVE [key2] => 2017 [key3] => 2 [key4] => rad ) <br>Array ( [key] => Mercedes-Maybach S600 [key2] => 2017 [key3] => 4 [key4] => black ) <br>