This is almost certainly a duplicate of this question but I guess my question is more about common conventions/best practices, given the answers there.
Example:
if(isset($this->_available[$option]['accepts_argument']) && $this->_available[$option]['accepts_argument']) {
// do something
}
It's just ugly. But if I don't do the first check, I get a php NOTICE. Should I make sure the array key 'accepts_argument' always exists, and defaults to false? That way I could just test if it's true, instead of also testing if it exists?
Should I just not worry about the ugliness/verbosity ?
I'm noticing this pattern a lot in my code, and just wondering how people handle it. I'm currently using php 5.4, if that matters, but I could upgrade it if there's something fancy in 5.5+ that I could do.
Thanks