开发者

function not running properly? (Tank Auth)

开发者 https://www.devze.com 2023-03-07 08:10 出处:网络
Could someone please explain why there is a difference between function foo($a){$blah = $a}....... foo($CONSTANT);

Could someone please explain why there is a difference between

function foo($a){$blah = $a}.......
foo($CONSTANT); 

and

function foo() { $blah = $CONSTANT}.......
foo();

The top method is working for me, the other is not. Specifically the below finds the if statement false:

$this->setsession($user->id,$user->email, ($user->activated == 1) ? STATUS_ACTIVATED : STATUS_NOT_ACTIVATED);

                        if ($user->act开发者_如何学Pythonivated == 0) {                            // fail - not activated
                            $this->error = array('not_activated' => '');

While this one finds it true:

$this->setsession();

                        if ($user->activated == 0) {                            // fail - not activated
                            $this->error = array('not_activated' => '');


Sorry for a poorly written question. The difference is variable scope, I need to pass the variables because the ones I was calling were not able to be referenced.

0

精彩评论

暂无评论...
验证码 换一张
取 消