是否有称为空合并运算符的东西,例如 Null 合并运算符

I a*_*son 5 php function

PHP 7 添加了空合并运算符

// Fetches the value of $_GET['number'] and returns 'nonumber -NULL'
// if it does not exist.
$username = $_GET['number'] ?? 'No Number';
// This is equivalent to:
$username = isset($_GET['number']) ? $_GET['number'] : 'No Number';
Run Code Online (Sandbox Code Playgroud)

还有空的东西吗?

寻找类似的东西,

/ Fetches the value of $_GET['number'] and returns '0' Empty
// if it does not empty.
$username = $_GET['number'] ?? 'no number or number is 0 or empty';
Run Code Online (Sandbox Code Playgroud)

Pet*_*ter 3

是的,由于类型强制,短三元运算符?: