3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php for($i=1;$i<=40;$i++){ if(! isset(${"horario" . $i})) ${"horario" . $i} = $i; $myArray[${"horario" . $i}] = 'horario'.$i; } print_r( $myArray );
based on jF3OK
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
Array ( [1] => horario1 [2] => horario2 [3] => horario3 [4] => horario4 [5] => horario5 [6] => horario6 [7] => horario7 [8] => horario8 [9] => horario9 [10] => horario10 [11] => horario11 [12] => horario12 [13] => horario13 [14] => horario14 [15] => horario15 [16] => horario16 [17] => horario17 [18] => horario18 [19] => horario19 [20] => horario20 [21] => horario21 [22] => horario22 [23] => horario23 [24] => horario24 [25] => horario25 [26] => horario26 [27] => horario27 [28] => horario28 [29] => horario29 [30] => horario30 [31] => horario31 [32] => horario32 [33] => horario33 [34] => horario34 [35] => horario35 [36] => horario36 [37] => horario37 [38] => horario38 [39] => horario39 [40] => horario40 )