Since SQLite3Result::numRows is unavailable, use:
<?php
if ($res->numColumns() && $res->columnType(0) != SQLITE3_NULL) {
// have rows
} else {
// zero rows
}
?>
Because when there are zero rows:
* SQLite3Result::fetchArray will return '1'
* SQLite3Result::numColumns will return '1'
* Column type for column '0' will be SQLITE3_NULL