title: Can't use method return value in write context
body: <p>The following if condition is causing an error:</p>
  
  <pre><code>if( !empty ($this -&gt; session -&gt; userdata( 'user_id') ) )
  {
      $user_id = $this -&gt; session -&gt; userdata( 'user_id' );
  } 
  else 
  { 
      $error = "ID doesn't exist";
  }
  </code></pre>
  
  <p>I get following error:</p>
  
  <pre><code>Fatal error: Can't use method return value in write context in (line number)
  </code></pre>
  
  <p>How can I fix it?</p>