title: function in class, run only if variable is not set, PHP
body: <p>I want to write function in class. I want to run this function only if one variable is not set.
  I have 3 thoughts about this, but I do not know which one is best and looks "more professional".</p>
  
  <p>1:</p>
  
  <pre><code>if (!isset($this-&gt;variable) {
       $this-&gt;functionXxx();
  }
  </code></pre>
  
  <p>2: </p>
  
  <pre><code>private function functionXxx()
  {
       if (!isset($this-&gt;variable)) {
           //code here
       } 
  }
  </code></pre>
  
  <p>3:</p>
  
  <pre><code>private function functionXxx()
  {
       if (isset($this-&gt;variable)) {
           return;
       } 
       //code here
  }
  </code></pre>