title: PHP method return without value
body: <p>I'm in a phase of migrating to 100% OO php and I end up with lots of questions like these. So excuse me if you find it stupid, I'm just trying to make my OO programming practices good in the start so that I don't have to fix them later.</p>
  
  <p>Is it OK to do this?</p>
  
  <pre><code>private function _some_funct($args) {
      // Some code here....
      if ($something) return;
  
      //Rest of code
  }
  </code></pre>
  
  <p>Basically, there are 2 questions here. </p>
  
  <ol>
  <li><p>Is it OK to use <strong>return</strong> with no value after it? I use it a LOT and haven't encoutered any drawbacks, but never saw it in somebody else's code. I only saw <strong>return false</strong>.</p></li>
  <li><p>Is stopping functions this way OK generally or should I rethink my program's structure?</p></li>
  </ol>
  
  <p>Example of using this would be CMS I'm making.</p>
  
  <pre><code>public function _init_engines() {
      $this-&gt;_session_engine = $this-&gt;_dep['SessionEngine'];
      $this-&gt;_login_engine = $this-&gt;_dep['LoginEngine'];
      if ($this-&gt;_dep['User'] == false) return;   
      $this-&gt;_security_engine = $this-&gt;_dep['SecurityEngine'];
      //Other engines go here.......
  }
  </code></pre>
  
  <p>So I let system start session and setup session vars, then check if user is logged in. If user isn't logged in LoginEngine takes care of that and loads 'Login' module. Once Login module is loaded, I don't want other engines to be instantiated since they are not needed. I could have used <em>die</em> or <em>exit</em> but that would stop whole script from executing. Like this, My script finishes executing, and other things that aren't engines, like benchmarks and some other stuff still get executed which is just what I want. Again, should I reconsider my logic here or is this way OK in your opinion?</p>