📜  可选链运算符 php 代码示例

📅  最后修改于: 2022-03-11 14:54:40.131000             🧑  作者: Mango

代码示例1
Optional chaining is not supported in php ( ?. operator )
But you can use something like this

if ($a && $a->$b && $a->$b->$c) {
  $d = $a->$b->$c;
}

$d = $a?->$b?->$c;
// assigns null to $d upon failure