3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = array(array([0]=>'Ekin'),array([0]=>'Luna'),array([0]=>'Asd')); for ($i=0; $i < count($a); $i++) { if($i < 1){ $fname = $a[0][0]; } else { $fname = $a[$i-1][0]; } echo $fname; }
Output for 7.0.0
Fatal error: Illegal offset type in /in/C9F26 on line 2
Process exited with code 255.
Output for 5.5.24 - 5.5.35, 5.6.8 - 5.6.28
Warning: Illegal offset type in /in/C9F26 on line 2 Warning: Illegal offset type in /in/C9F26 on line 2 Warning: Illegal offset type in /in/C9F26 on line 2 Notice: Undefined offset: 0 in /in/C9F26 on line 5 Notice: Undefined offset: 0 in /in/C9F26 on line 7 Notice: Undefined offset: 0 in /in/C9F26 on line 7

preferences:
172.5 ms | 1396 KiB | 35 Q