开发者

function not running properly? (Tank Auth)

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜