Closed maurobn closed 1 year ago
Could you paste the PHP code of the class inheriting from the AbstractStructArrayBase
class? And the code creating the object inheriting from the AbstractStructArrayBase
class ?
Because normally the property, namely returned by $this->getAttributeName()
, should be initialized as an array. So the $this->getPropertyValue($this->getAttributeName())
call returns an array. This is taken care of when the inherited classes are generated from a WSDL.
no feedback, feel free to reopen
It occurs only in PHP8. When we try to navigate in a AbstractStructArrayBase, usinf for in a twig template, on using foreach in a php code, an incompatible type exception is raised. When the array object is initialized, the initInternArray of the abstract class AbstractStructArrayBaseis called for the first time, with no parameter. In these situation, the execution flows to the elseif branch, and once again, recursively, initInternArray is called again, this time with parameter.
He an exception is raised because AbstractStructArrayBase doesn't match array type (this classes doesn't implement AbstractObject, so it's no possible to pass such object as an array).
To Reproduce To get the exception raised, just use an AbstractStructArrayBase child (a concrete class) in a foreach loop. foreach($childAbstractStructArrayBase as $item) { .... }
Expected behavior To be possible to use an AbstractStructArrayBase in a foreach loop.
Additional context Add any other context about the problem here.