- Address https://github.com/friendica/friendica/issues/9250#issuecomment-
741857058
/**
* Fetch a single row
*
- * @param mixed $stmt statement object
+ * @param PDOStatement|mysqli_stmt $stmt statement object
*
- * @return array current row
+ * @return array|false current row
*/
public function fetch($stmt)
{
-
$stamp1 = microtime(true);
$columns = [];
break;
case self::MYSQLI:
if (get_class($stmt) == 'mysqli_result') {
- $columns = $stmt->fetch_assoc();
+ $columns = $stmt->fetch_assoc() ?? false;
break;
}
* Fetch a single item row
*
* @param mixed $stmt statement object
- * @return array current row
+ * @return array|false current row or false
+ * @throws \Exception
*/
public static function fetch($stmt)
{
$row = DBA::fetch($stmt);
- if (is_bool($row)) {
+ if (!is_array($row)) {
return $row;
}