I need to edit a function, but I cant figure out what the ? and the : false mean in the return statement. I think the : is an OR but the ? I dont know.
public function hasPermission($name)
{
return $this->getVjGuardADUser() ? $this->getVjGuardADUser()->hasPermission($name) : false;
}
Anyone that can clear this up for me?
It is PHP’s Ternary Operator. It’s like a shorthand for if/else expressions.
Your expanded code could look like so:
Some sample-code from php.net: