How can unexpected '{' error in if condition be fixed in PHP? : <p>my php code is</p>

<pre><code>&lt;?php
session_start();
if(!isset($_SESSION["userId"]){
header('Location: index.php');
exit;
}
?&gt;
</code></pre>

<p>and i got an error</p>

<pre><code>Parse error: syntax error, unexpected '{' in C:\xampp\htdocs\page\login.php on line 3
</code></pre>

<p>can anyone help me to solve this problem</p>
