title: Cakephp fail to return a value form child function to parent function
body: <p>I get an issue while return a value from recursive function, I have except return some value which I was return in another function, EX: If i was print a value in <code>test3</code> function it printed and also it's returns the parent function <code>test2</code> here also printed the return value, but when I print in main function <code>test1</code> it's not printed why it's behave like this?</p>
  
  <p>I have tried this below code:</p>
  
  <pre><code>class TestController extends AppController {
     public function beforeFilter() {
          parent::beforeFilter();
          ---------#code
     }
     public function test1(){
         $parm1 = $_POST['val1'];
         $parm2 = $_POST['val2'];
         $res = $this-&gt;test2($parm1,$parm2);
         pr($res);
     }
     private function test2($parm1,$parm2){
         #calculations
         if(condition){
             #$parm2 value increment
             $this-&gt;test2($parm1,$parm2);               
         }else{
             $valf =  $this-&gt;test3($parm1,$parm2);
             #here I print $valf it's printed but it's not return a value
             return $valf ;
         } 
     }
     private function test3($parm1,$parm2){
         #calculations
         if(condition){  
             $val = somevalue;
             return $val;
         }else{
             return false;
         } 
     }
  }
  </code></pre>