This function doesn't work with LIMIT used jointly with SQL_CALC_FOUND_ROWS. If you want to obtain the total rows found you must do it manually, example:
<?php
public function errorList(int $limit=25,int $offset=0){
$errorList = array();
$result = $this->con->query("SELECT SQL_CALC_FOUND_ROWS id, erreur FROM Erreurs ORDER BY id DESC LIMIT $limit OFFSET $offset");
while($row = $result->fetch_assoc()){
$errorList[] = new Erreur($row);
}
$result->free();
// $foundRows = $result->num_rows; // 25
$foundRows = $this->con->query("SELECT FOUND_ROWS() as foundRows");
$this->foundRows = $foundRows->fetch_assoc(); // 178
return $errorList;
}
?>