PHP: Null coalescing operator
I am trying to understand how the null coalescing operator really does work. So, I tested many examples after reading the documentation in php.net and some posts on Stack Overflow. However, I can't understand this code: <?php $x = false ?? 'stackoverflow'; var_dump($x); // bool(false) since it's equivalent to (from Null coalescing operator) isset(false) ? false : 'stackoverflow'; and since isset(false) generates a fatal error. What is the explanation?
0 upvotes
View original discussion ↗
Comments
Sign in or sign up to comment and upvote.
No comments yet.