我有这样的课:
class Example {
private function _test($value)
{
if ($value == 'xyz') return FALSE;
}
public function check()
{
$this->_test('xyz');
// more code follows here...
}
}
基本上我想要做的是“冒泡”方法_test()的返回值FALSE作为方法check()的实际返回值,以便调用
$this->_test('xyz');
将返回 FALSE
return $this->_test('xyz');
行不通,因为如果值与“xyz”不匹配,我不想返回。
这有可能吗?