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?
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?
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;
This may be naive but $disabled_warning is just storing the Boolean result of the condition.
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');