Is this a PHP function?

I saw this in facebook leaked text ...

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

      

now if I am not reading it wrong then it says that (($ var) can be used like a function?

+2


source to share


3 answers


No, it just sets it to true or false.

It would be tantamount to this:



if((IS_DEV_SITE || IS_QA_SITE) && is_disabled_user($user))
  $disabled_warning = true;
else
  $disabled_warning = false;

      

+9


source


It might be naive, but $ disabled_warning only preserves the boolean result of the condition.



0


source


function variables look like regular functions anyway, except for the dollar sign in front in PHP.

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

$bar = 'foo';

$bar('Cool');

      

0


source







All Articles