有人可以解释为什么两者之间存在差异
function foo($a){$blah = $a}.......
foo($CONSTANT);
和
function foo() { $blah = $CONSTANT}.......
foo();
最上面的方法对我有用,另一种方法不行。具体来说,以下发现 if 语句为假:
$this->setsession($user->id,$user->email, ($user->activated == 1) ? STATUS_ACTIVATED : STATUS_NOT_ACTIVATED);
if ($user->activated == 0) { // fail - not activated
$this->error = array('not_activated' => '');
虽然这个发现是真的:
$this->setsession();
if ($user->activated == 0) { // fail - not activated
$this->error = array('not_activated' => '');