3v4l.org

run code in 300+ PHP versions simultaneously
<?php if(isset($_GET['lang'])){ if ($_GET['lang']){ $lang = $_GET['lang']; SetCookie("lang",$_GET["lang"]); } elseif ($_COOKIE['lang']){ $lang = $_COOKIE['lang']; }else { $lang = $_SERVER["HTTP_ACCEPT_LANGUAGE"]; } if($lang == 'fr'){ \$xmlstr=<<<XML; include('labelsfr.xml'); XML; }if($lang == 'en'){ \$xmlstr=<<<XML; include('labelsen.xml'); XML; } } ?>
Output for 5.4.0 - 5.4.29
Parse error: syntax error, unexpected '$xmlstr' (T_VARIABLE), expecting identifier (T_STRING) in /in/vs7af on line 14
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected T_VARIABLE, expecting T_STRING in /in/vs7af on line 14
Process exited with code 255.
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.1.6, 5.2.0 - 5.2.17
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/vs7af on line 14 Parse error: syntax error, unexpected T_SL in /in/vs7af on line 14
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
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/vs7af on line 14 Parse error: parse error, unexpected T_SL in /in/vs7af on line 14
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/vs7af on line 14 Parse error: parse error in /in/vs7af on line 14
Process exited with code 255.

preferences:
210.76 ms | 1395 KiB | 119 Q