Cast to stdClass on return instead of each iteration