PHP isset() vs empty() vs is_null() vs if($var) vs ??

See blog article for explanation.

PHP version is 7.4.24
Value of variable ($var)isset($var)empty($var)is_null($var)if($var)$var ?? '-'
Null Coalesce Operator (since PHP 7.0)
'' (an empty string)bool(true) bool(true) bool(false) falsestring(0) ""
" " (space)bool(true) bool(false) bool(false) truestring(1) " "
" " (two spaces)bool(true) bool(false) bool(false) truestring(2) " "
falsebool(true) bool(true) bool(false) falsebool(false)
FALSEbool(true) bool(true) bool(false) falsebool(false)
truebool(true) bool(false) bool(false) truebool(true)
TRUEbool(true) bool(false) bool(false) truebool(true)
array() (an empty array)bool(true) bool(true) bool(false) falsearray(0) { }
new stdClass() (an empty object)bool(true) bool(false) bool(false) trueobject(stdClass)#147 (0) { }
NULLbool(false) bool(true) bool(true) falsestring(1) "-"
"0" (0 as a string)bool(true) bool(true) bool(false) falsestring(1) "0"
0 (0 as an integer)bool(true) bool(true) bool(false) falseint(0)
0.0 (0 as a float)bool(true) bool(true) bool(false) falsefloat(0)
var $var; (a variable declared, but without a value)bool(false) bool(true) bool(true) falsestring(1) "-"
NULL byte ("\0")bool(true) bool(false) bool(false) truestring(1) ""