Thanks for sharing it.
This begins to look a lot like the nasty overloaded PDOStatement::fetchAll. It would also be nice to have fetch_all for a single column, and then we have it. I'd rather we avoid that if we want to expand mysqli functionalities. How about adding mysqli_fetch_all_object? No need for a new constant and we don't back ourselves into a corner.