COUNTA(B1,B2,B3,B4) should count each cell which is not NULL. In this case, however, the function is passed an argument
array(4) {
[0] => NULL
[1] => NULL
[2] => NULL
[3[ => NULL
}
and when examined, each index is treated as not a cell value by Functions::isCellValue() (because it lacks two dots) and thus counted by COUNTA(). While Excel evaluates the expression above to 0 (if all cells are empty), PhpSpreadsheet (4.5.0) returns 4.
I did not check, but COUNT will most likely suffer from the same problem.
test.xlsx