title: What is the equivalent of isset for object's methods in CodeIgniter?
body: <p>In my CodeIgniter application I use session class in some controllers (Not all of them) and I have fixed theme view rendered in all page. I'd like to use <code>session-&gt;setflash()</code> in the view. So, for controllers that don't use session I have to check if the <code>session-&gt;flashdata()</code> is set or available or not. I have tried the follwoing:</p>
  
  <pre><code>&lt;?php if (isset($this-&gt;session-&gt;flashdata('msg'))):;?&gt;
  </code></pre>
  
  <p>It returned the following error:</p>
  
  <blockquote>
    <p>Fatal error: Cannot use isset() on the result of a function call (you
    can use "null !== func()" instead)</p>
  </blockquote>
  
  <p>When I tried the suggestion of the message:</p>
  
  <pre><code>&lt;?php if (null !== $this-&gt;session-&gt;flashdata('msg')):;?&gt;
  </code></pre>
  
  <p>I got the following error:</p>
  
  <blockquote>
    <p>Fatal error: Call to a member function flashdata() on a non-object
    in...</p>
  </blockquote>
  
  <p>Beside a codeIgniter error:</p>
  
  <blockquote>
    <p>A PHP Error was encountered Severity: Notice</p>
    
    <p>Message: Undefined property: CI_Loader::$session</p>
    
    <p>Filename: themes/head.php</p>
    
    <p>Line Number: 44</p>
  </blockquote>