By the way, this case pretty work's too:
$services = $mysqli->query("SELECT * FROM table1");
if($services && $services->num_rows>0){
$services->fetch_all(MYSQLI_ASSOC);
}
foreach($services as $service){
echo $service; //work properly, cause it implements Iterator
}
That's mean in this case $services is a valid array (or empty array)