3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $SPW = array("1"=>"38", "2"=>"39", "3"=>"40", "4"=>"41", "5"=>"42", "6"=>"45", "7"=>"46", "8"=>"47", "9"=>"48", "10"=>"49", "11"=>"50", "12"=>"51", "13"=>"2", "14"=>"3", "15"=>"4", "16"=>"8", "17"=>"10", "18"=>"11", "19"=>"12", "20"=>"13", "21"=>"16", "22"=>"17"); $current_week_number = date('W'); for($row = 0; $row < 23; $row++) { $x=0; foreach($SPW[$row] as $key => $value) { if($current_week_number== $key) { echo $current_week_number . " " . $key; } $x++; } }
based on AA8P2
Output for 5.3.0 - 5.6.28, 7.0.0 - 7.1.0
Notice: Undefined offset: 0 in /in/gtNhf on line 10 Warning: Invalid argument supplied for foreach() in /in/gtNhf on line 10 Warning: Invalid argument supplied for foreach() in /in/gtNhf on line 10 Warning: Invalid argument supplied for foreach() in /in/gtNhf on line 10 Warning: Invalid argument supplied for foreach() in /in/gtNhf on line 10 Warning: Invalid argument supplied for foreach() in /in/gtNhf on line 10 Warning: Invalid argument supplied for foreach() in /in/gtNhf on line 10 Warning: Invalid argument supplied for foreach() in /in/gtNhf on line 10 Warning: Invalid argument supplied for foreach() in /in/gtNhf on line 10 Warning: Invalid argument supplied for foreach() in /in/gtNhf on line 10 Warning: Invalid argument supplied for foreach() in /in/gtNhf on line 10 Warning: Invalid argument supplied for foreach() in /in/gtNhf on line 10 Warning: Invalid argument supplied for foreach() in /in/gtNhf on line 10 Warning: Invalid argument supplied for foreach() in /in/gtNhf on line 10 Warning: Invalid argument supplied for foreach() in /in/gtNhf on line 10 Warning: Invalid argument supplied for foreach() in /in/gtNhf on line 10 Warning: Invalid argument supplied for foreach() in /in/gtNhf on line 10 Warning: Invalid argument supplied for foreach() in /in/gtNhf on line 10 Warning: Invalid argument supplied for foreach() in /in/gtNhf on line 10 Warning: Invalid argument supplied for foreach() in /in/gtNhf on line 10 Warning: Invalid argument supplied for foreach() in /in/gtNhf on line 10 Warning: Invalid argument supplied for foreach() in /in/gtNhf on line 10 Warning: Invalid argument supplied for foreach() in /in/gtNhf on line 10 Warning: Invalid argument supplied for foreach() in /in/gtNhf on line 10
Output for hhvm-3.10.0 - 3.12.0
Notice: Undefined index: 0 in /in/gtNhf on line 10 Warning: Invalid argument supplied for foreach() in /in/gtNhf on line 18 Warning: Invalid argument supplied for foreach() in /in/gtNhf on line 18 Warning: Invalid argument supplied for foreach() in /in/gtNhf on line 18 Warning: Invalid argument supplied for foreach() in /in/gtNhf on line 18 Warning: Invalid argument supplied for foreach() in /in/gtNhf on line 18 Warning: Invalid argument supplied for foreach() in /in/gtNhf on line 18 Warning: Invalid argument supplied for foreach() in /in/gtNhf on line 18 Warning: Invalid argument supplied for foreach() in /in/gtNhf on line 18 Warning: Invalid argument supplied for foreach() in /in/gtNhf on line 18 Warning: Invalid argument supplied for foreach() in /in/gtNhf on line 18 Warning: Invalid argument supplied for foreach() in /in/gtNhf on line 18 Warning: Invalid argument supplied for foreach() in /in/gtNhf on line 18 Warning: Invalid argument supplied for foreach() in /in/gtNhf on line 18 Warning: Invalid argument supplied for foreach() in /in/gtNhf on line 18 Warning: Invalid argument supplied for foreach() in /in/gtNhf on line 18
Output for 5.2.1 - 5.2.17
Notice: Undefined offset: 0 in /in/gtNhf on line 10 Warning: Invalid argument supplied for foreach() in /in/gtNhf on line 10 Warning: Invalid argument supplied for foreach() in /in/gtNhf on line 10 Warning: Invalid argument supplied for foreach() in /in/gtNhf on line 10 Warning: Invalid argument supplied for foreach() in /in/gtNhf on line 10 Warning: Invalid argument supplied for foreach() in /in/gtNhf on line 10 Warning: Invalid argument supplied for foreach() in /in/gtNhf on line 10 Warning: Invalid argument supplied for foreach() in /in/gtNhf on line 10 Warning: Invalid argument supplied for foreach() in /in/gtNhf on line 10 Warning: Invalid argument supplied for foreach() in /in/gtNhf on line 10 Warning: Invalid argument supplied for foreach() in /in/gtNhf on line 10 Warning: Invalid argument supplied for foreach() in /in/gtNhf on line 10 Warning: Invalid argument supplied for foreach() in /in/gtNhf on line 10 Warning: Invalid argument supplied for foreach() in /in/gtNhf on line 10 Warning: Invalid argument supplied for foreach() in /in/gtNhf on line 10 Warning: Invalid argument supplied for foreach() in /in/gtNhf on line 10 Warning: Invalid argument supplied for foreach() in /in/gtNhf on line 10 Warning: Invalid argument supplied for foreach() in /in/gtNhf on line 10 Warning: Invalid argument supplied for foreach() in /in/gtNhf on line 10 Warning: Invalid argument supplied for foreach() in /in/gtNhf on line 10 Warning: Invalid argument supplied for foreach() in /in/gtNhf on line 10 Warning: Invalid argument supplied for foreach() in /in/gtNhf on line 10 Warning: Invalid argument supplied for foreach() in /in/gtNhf on line 10 Warning: Invalid argument supplied for foreach() in /in/gtNhf on line 10
Output for 4.3.0 - 4.3.10, 4.4.0 - 5.2.0
Warning: Invalid argument supplied for foreach() in /in/gtNhf on line 10 Warning: Invalid argument supplied for foreach() in /in/gtNhf on line 10 Warning: Invalid argument supplied for foreach() in /in/gtNhf on line 10 Warning: Invalid argument supplied for foreach() in /in/gtNhf on line 10 Warning: Invalid argument supplied for foreach() in /in/gtNhf on line 10 Warning: Invalid argument supplied for foreach() in /in/gtNhf on line 10 Warning: Invalid argument supplied for foreach() in /in/gtNhf on line 10 Warning: Invalid argument supplied for foreach() in /in/gtNhf on line 10 Warning: Invalid argument supplied for foreach() in /in/gtNhf on line 10 Warning: Invalid argument supplied for foreach() in /in/gtNhf on line 10 Warning: Invalid argument supplied for foreach() in /in/gtNhf on line 10 Warning: Invalid argument supplied for foreach() in /in/gtNhf on line 10 Warning: Invalid argument supplied for foreach() in /in/gtNhf on line 10 Warning: Invalid argument supplied for foreach() in /in/gtNhf on line 10 Warning: Invalid argument supplied for foreach() in /in/gtNhf on line 10 Warning: Invalid argument supplied for foreach() in /in/gtNhf on line 10 Warning: Invalid argument supplied for foreach() in /in/gtNhf on line 10 Warning: Invalid argument supplied for foreach() in /in/gtNhf on line 10 Warning: Invalid argument supplied for foreach() in /in/gtNhf on line 10 Warning: Invalid argument supplied for foreach() in /in/gtNhf on line 10 Warning: Invalid argument supplied for foreach() in /in/gtNhf on line 10 Warning: Invalid argument supplied for foreach() in /in/gtNhf on line 10 Warning: Invalid argument supplied for foreach() in /in/gtNhf on line 10
Output for 4.3.11