foreach() argument must be of type array|object, bool given