For this case I've made use of fgetcsv()
// Count Lines
$handle = fopen($csvfile, "r");
$numrows = 0;
while (($data = fgetcsv($handle, 0)) !== FALSE) {
$numrows++;
}
fclose($handle);
The second arg of fgetcsv (length) can be null since PHP 8.0