3v4l.org

run code in 300+ PHP versions simultaneously
<?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'); $current_date = date('d/m/Y'); 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++; } }
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.1.6, 5.2.0 - 5.2.17, 5.3.0 - 5.3.29, 5.4.0 - 5.4.32
Parse error: syntax error, unexpected '}', expecting ',' or ';' in /in/LHQL0 on line 17
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.3.11, 4.4.0 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected '}', expecting ',' or ';' in /in/LHQL0 on line 17
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `','' or `';'' in /in/LHQL0 on line 17
Process exited with code 255.

preferences:
214.94 ms | 1395 KiB | 123 Q