Changes to num_rows function for hhvm