Given the following expression:
$att['menutext'] = isset($attrib_in['i_menu_text']) ? : $this->getID();
If it evaluates to true, will $att['menutext']
be set to true
or $this->getID()
?
Yes, in version 5.3+ the middle expression is optional and returns true.
$a = (true ? : 1); // $a evaluates to true.
$a = (false ? : 1); // $a evaluates to 1.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With