$is_unpack = false;
// Handle argument unpacking as a last resort
foreach ($call['parameters'
] as $i => &
$param) { if (0 === \
strpos($param['name'
], '...'
)) { $is_unpack = true;
// If we're on the last param
if ($i <
$argc &&
$i === \
count($call['parameters'
]) - 1
) { unset($call['parameters'
][$i]);
if (Utils::
isAssoc($args)) { // Associated unpacked arrays can be accessed by key
$keys = \
array_slice(\
array_keys($args),
$i);
foreach ($keys as $key) { $call['parameters'
][] =
[ 'name' => \
substr($param['name'
], 3
).'['.\
var_export($key, true
).']',
'path' => \
substr($param['path'
], 3
).'['.\
var_export($key, true
).']',
'expression' => false,
];
} } else {