Trying to parse command line options I've found the following code throws a notice:
$options = getopt('p:', array('path:'));
$options['p'] = 'some file path';
$path = isset($options['p']) ? $options['p'] : isset($options['path']) ? $options['path'] : null;
Notice:
Notice: Undefined index: path
Why aren't the assigneds evaluated left-to-right starting with the isset($options['p'])
?