Can you help me? Is there someone can explain the meaning of this line of php code?
$options = ($options ?: array()) + $this->options;
Thanks
Can you help me? Is there someone can explain the meaning of this line of php code?
$options = ($options ?: array()) + $this->options;
Thanks
That is equivalent to this:
if (!$options)
$options = array();
$options = $options + $this->options;
the ?:
is the ternary operator. If $options
evaluates to true it is returned, otherwise an empty array is returned.
The +operator
given two arrays creates a new array by concatenating them