Problem/Motivation
When the Statement classes were developed, they were meant to be extensions of the base PDOStatement class.
As we moved on, Statement classes are now largely decoupled from PDO, but for fetch mode we still support all the PDO-provided modes, even though some of them are not really used - just to keep compatibility with PDO. Non-PDO drivers (and the prefetching statement) are therefore forced to develop and maintain compatibility layers to mimick PDO behavior, for no purpose.
FTR, doctrine/dbal has reduced the supported fetch modes, and dropped using \PDO::FETCH_* constants in favour of an abstract implementation.
Candidate modes for deprecation:
- \PDO::FETCH_BOTH
\PDO::FETCH_CLASS- \PDO::FETCH_CLASS | \PDO::FETCH_CLASSTYPE
\PDO::FETCH_COLUMN- \PDO::FETCH_LAZY
- \PDO::FETCH_INTO
Proposed resolution
Only allow these fetch modes:
- \PDO::FETCH_ASSOC,
- \PDO::FETCH_CLASS,
- \PDO::FETCH_CLASS | \PDO::FETCH_PROPS_LATE,
- \PDO::FETCH_COLUMN,
- \PDO::FETCH_NUM,
- \PDO::FETCH_OBJ,
Deprecate unused fetch modes for removal in a future major.