user5678
0
Q:

optional chain operator php

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
0

New to Communities?

Join the community