Don't walk objects with array_walk_recursive()

Fixes #1788