title: Why is isset($this->var) always returning false in my Codeigniter model?
body: <p>I'm using Codeigniter 3 with PHP 7.</p>
  
  <p>In one of my models, I'm trying to set a user id variable if a user is logged in and save it to a db. In all of my controllers, there is a session check at the top and if the user is logged in, it sets $this->uid. The code I am using in the model is shown below. $uid always saves as NULL.</p>
  
  <pre><code>if(isset($this-&gt;uid)){
      $uid = $this-&gt;uid;
  }else{
      $uid = NULL;
  }
  </code></pre>
  
  <p>If I try without the boolean (as shown below), the $uid var returns the user id value and saves properly to the db if the user is logged in and an error if the user is not logged in. So I'm confident the error is not a missing value in $this->uid.</p>
  
  <pre><code>$uid = $this-&gt;uid;
  </code></pre>