While browsing the code of an open source PHP library I spotted this line:
$path = $path ?: $this->guessPackagePath();
This is not the ternary operator like it usually apprears. Would anyone explain what is going on in it?
It's a shortcut for
$path = $path ? $path : $this->guessPackagePath();
which comes from PHP 5.3
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