Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Result::setFetchMode() cannot drive FETCH_CLASS or FETCH_INTO

オープン
#198 コメント 0 件 リアクション 0 件 担当者 1 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@simon-mundy がすでに取り組んでいます。

2026年9月29日 から。

評価

この issue はまだ評価されていません。

説明

bug confirmed

Pdo\Result::setFetchMode(int $fetchMode) accepts only an int. PDOStatement::fetch() needs a class name for FETCH_CLASS and a target object for FETCH_INTO, and there is no way to supply either.

Both are listed in Result::VALID_FETCH_MODES, so setFetchMode() accepts them and the failure surfaces later, on the first fetch:

FETCH_CLASS  PDOException: SQLSTATE[HY000]: General error: No fetch class specified
FETCH_INTO   PDOException: SQLSTATE[HY000]: General error: No fetch-into object specified.

Reproduced against SQLite in memory; covered by ResultSetFetchModeTest::fetchModesNeedingExtraArgumentsCannotBeDriven, which currently asserts only that they throw.

Fix is either to widen setFetchMode() to take the extra arguments PDO requires, or to reject both modes up front instead of at fetch time.

主要言語
PHP
スター
18
フォーク
8
平均マージ
6日 11時間
マージ済み PR(30日)
14

環境構築

  • Dockerfile または Docker Compose ファイルあり
  • プルリクエストのテンプレートなし
  • コントリビューションガイドなし

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

php-db/phpdb のほかの issue

php-db/phpdb の issue をすべて見る

似ている issue

PHP の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。