Is there a "nullsafe operator" in PHP?
Is there any way to write the following statement using some kind of safe navigation operator? echo $data->getMyObject() != null ? $data->getMyObject()->getName() : ''; So that it looks like this: echo $data->getMyObject()?->getName();
0 upvotes
View original discussion ↗
Comments
Sign in or sign up to comment and upvote.
No comments yet.