foreach for obj and arrays