I am trying to understand how php hadles this examples.
(\Auth::check() || \Auth::user()->isAdmin())
(\Auth::check() && \Auth::user()->isAdmin())
\Auth::check() gives only false or true while \Auth::user()->isAdmin() can give true, false or user object can be null and isAdmin() function gives error.
When I run (\Auth::check() || \Auth::user()->isAdmin()) it gives me error because \Auth::check() is false and \Auth::user() is null, but when I replace || with && it's ok although user object still null and isAdmin function must give error.
P.S. Sorry for the vague question (I don't know what to do if there is need to change question but there are answers already) Some clarification: I suspect that when there is && and php checks first argument and it is false then php never checks other. Am I right? I think so because in my case (false && null->method) give just false but (false || null->method) gives error because of null->method