In the basic example below I'm expecting that the one() method terminates the two() method when the if statements returns true, but it always returns 'something'. How can I terminate the execution of method two() from method one()?
Class MYclass {
// This method must ends two()
private function one($var){
if( $var == 'value' ) {
return;
}
}
public function two(){
$this->one('value'); // if parameter is 'value' this must ends here
return 'something'; // else it will return something
}
}
$three = new Myclass;
echo $three->two(); // This outputs 'something' but I'm expecting nothing