We should also manage array-like objects:
`} elseif (is_array($arg) || $arg instanceof Traversable) {`
I've used something similar without the level limitation here: https://github.com/Work4Labs/work4us/blob/master/lib/util/w4lLog.class.php#L188-232

It also handles *ressource* types.