Reverse the order of `is_array()` and `empty()` (see #5469)