How to signal an stdClass containing other stdClass? #10346
-
Hello everyone. Most of the times I got Since I work with stdClass, I can mark class properties or function/method parameters as stdClass and the error goes away. But when I have objects containing other objects, I still get the error for the objects of the second level (the ones contained into the main object). So my question is: how can I mark a variable as an stdClass containing other stdClass? I can do a similar thing with array of objects writing |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Can you try to give a code example? If your variable is marked as |
Beta Was this translation helpful? Give feedback.
Unfortunately I can't because the code is too complex to reproduce.
But I managed to resolve it marking the temporary variable as
stdClass
. I was accessing the properties from the main object, but if I retrieve a property and put it in a temporary variable, marking it asstdClass
, the error goes away.