nullsafe Questions

4

Solved

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 l...
Floatable asked 10/9, 2012 at 12:28

2

Solved

Php 8.0 introduced the nullsafe operator which can be used like so $foo?->bar?->baz;. I have a code sample running on php 8.1 that throws the error Undefined property: stdClass::$first_name e...
Shurwood asked 12/4, 2022 at 16:13
1

© 2022 - 2024 — McMap. All rights reserved.