3v4l.org

run code in 300+ PHP versions simultaneously
<?php $someArray = new Array("key1" => "value1", "key2" => "value2", "key3" => "value3", "key4" => "value4"); $len = count($someArray); $i = 0; foreach($someArray AS $key => $value) { if($i == $len - 1) { echo "This is the last line!"; } else { echo "This is line $i\n"; } $i++; }
Output for 5.4.0 - 5.4.13
Parse error: syntax error, unexpected 'Array' (T_ARRAY) in /in/62Cdg on line 2
Process exited with code 255.
Output for 5.3.0 - 5.3.23
Parse error: syntax error, unexpected T_ARRAY in /in/62Cdg on line 2
Process exited with code 255.

preferences:
162.44 ms | 1395 KiB | 45 Q