Hello I am making this call:
$parts = $structure->parts;
Now $structure only has parts under special circumstances, so the call returns me null. Thats fine with me, I have a if($parts) {...} later in my code. Unfortunately after the code finished running, I get this message:
Notice: Undefined property: stdClass::$parts in ...
How can I suppress this message?
The function isset
should do exactly what you need.
Example:
$parts = (isset($structure->parts) ? $structure->parts : false);