3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $dias = array('Domingo','Lunes','Martes','Miercoles','Jueves','Viernes','Sabado'); $mes = array(); //Recorro 4 semanas for($i=0;$i<4;$i++){ //Por cada semana recorro la cantidad de dias que tiene la semana. $diasSemana = count($dias); for($j=0;$j<$diasSemana;$j++){ //En la posicion correcta Semana => Dia, ubico el nombre del dia $mes[$i][$j] = $dias[$j]; } } foreach ($mes[$i][$j] as $sem) { echo $sem; } ?>
Output for 5.3.0 - 7.1.7
Notice: Undefined offset: 4 in /in/O6BcI on line 17 Warning: Invalid argument supplied for foreach() in /in/O6BcI on line 17
Output for 5.2.1 - 5.2.17
Notice: Undefined offset: 4 in /in/O6BcI on line 17 Warning: Invalid argument supplied for foreach() in /in/O6BcI on line 17
Output for 4.3.0 - 4.3.10, 4.4.0 - 5.2.0
Warning: Invalid argument supplied for foreach() in /in/O6BcI on line 17
Output for 4.3.11