tags:

views:

117

answers:

3

I saw this in a facebook leaked code...

$disabled_warning = ((IS_DEV_SITE || IS_QA_SITE) && is_disabled_user($user));

now unless I am reading it wrong then it is saying that (($var) can be used as a function?

+8  A: 

No, it's just setting the value to true or false.

It would be equivalent to this:

if((IS_DEV_SITE || IS_QA_SITE) && is_disabled_user($user))
  $disabled_warning = true;
else
  $disabled_warning = false;
Kip
Ahh I see now not sure why I didn't notice the ending ), thanks for the answer though
jasondavis
A: 

This may be naive but $disabled_warning is just storing the Boolean result of the condition.

Theo.T
A: 

anyway variable functions look something like normal functions except with a dollar sign in front in PHP.

function foo($s){
  echo $s;
}

$bar = 'foo';

$bar('Cool');
thephpdeveloper