You might be having a larger (although - hidden) problem. A structure in your code should not cross more than one layer boundary.
If some structure (doesn't matter whether it is an array or an object) is crossing two layers, then, unless it is an intentional compromise, it is a sign, that there might be "architectural flaws" indicating fragility of your codebase. Such cross-cutting data structures become the fault-lines across witch your codebase exhibits none-trivial bugs.
If your have structures, that cross 3 or more layer boundaries, your codebase is fucked. It becomes one of those "kill it with fire, before it lays eggs" projects.
The solution that I use is this:
Instead of having dedicated "data structures" being passed around, focus your business logic around domain objects. You create it at some point in the layer, where you will be actually using it logic-related behaviour and inject it or return it to other layer only to affect it.
Kinda like this:
public function loginWithPassword(Entity\EmailIdentity $identity, string $password): Entity\CookieIdentity
{
if ($identity->matchPassword($password) === false) {
throw new PasswordMismatch;
}
$identity->setPassword($password);
$this->updateEmailIdentityOnUse($identity);
$cookie = $this->createCookieIdentity($identity);
return $cookie;
}
What is being passed in an out of this method is not some "data structure", but a fully formed logical entity, which contains specific, business-relate behaviour.