[doc-en] master: ext/pdo: document the PHP 8.5 fetch mode changes and deprecations (#5817)

From: Date: Tue, 01 Sep 2026 13:05:17 +0000
Subject: [doc-en] master: ext/pdo: document the PHP 8.5 fetch mode changes and deprecations (#5817)
Groups: php.doc.cvs 
Request: Send a blank email to doc-cvs+get-23686@lists.php.net to get a copy of this message
Author: Louis-Arnaud (lacatoire) Committer: GitHub (web-flow) Pusher: kamil-tekiela Date: 2026-09-01T14:05:14+01:00 Commit: https://github.com/php/doc-en/commit/e16d04c436e9801627139c67c1cabcb92b469ccc Raw diff: https://github.com/php/doc-en/commit/e16d04c436e9801627139c67c1cabcb92b469ccc.diff ext/pdo: document the PHP 8.5 fetch mode changes and deprecations (#5817) Changed paths: M reference/pdo/pdo.xml M reference/pdo/pdo/construct.xml M reference/pdo/pdostatement/fetchall.xml M reference/pdo/pdostatement/setattribute.xml M reference/pdo/pdostatement/setfetchmode.xml Diff: diff --git a/reference/pdo/pdo.xml b/reference/pdo/pdo.xml index b15bf0da02e6..c0f23db28bd3 100644 --- a/reference/pdo/pdo.xml +++ b/reference/pdo/pdo.xml @@ -492,6 +492,17 @@ </row> </thead> <tbody> + <row> + <entry>8.5.0</entry> + <entry> + Driver-specific constants of the <classname>PDO</classname> class have + been deprecated in favor of the equivalent constants of the + driver-specific subclasses (<classname>Pdo\Dblib</classname>, + <classname>Pdo\Firebird</classname>, <classname>Pdo\Mysql</classname>, + <classname>Pdo\Odbc</classname>, <classname>Pdo\Pgsql</classname>, + <classname>Pdo\Sqlite</classname>). + </entry> + </row> <row> <entry>8.4.0</entry> <entry> diff --git a/reference/pdo/pdo/construct.xml b/reference/pdo/pdo/construct.xml index 3e15e707dea6..7acd78842f98 100644 --- a/reference/pdo/pdo/construct.xml +++ b/reference/pdo/pdo/construct.xml @@ -60,6 +60,13 @@ the DSN string. The URI can specify a local file or a remote URL. </para> <para><userinput>uri:file:///path/to/dsnfile</userinput></para> + <warning> + <simpara> + The <userinput>uri:</userinput> DSN scheme is deprecated as of + PHP 8.5.0 due to security concerns with DSNs coming from remote + URIs. + </simpara> + </warning> </listitem> </varlistentry> <varlistentry><term>Aliasing</term> @@ -113,11 +120,33 @@ <refsect1 role="errors"> &reftitle.errors; - <para> - A <classname>PDOException</classname> is thrown if the attempt + <simpara> + A <exceptionname>PDOException</exceptionname> is thrown if the attempt to connect to the requested database fails, regardless of which <constant>PDO::ATTR_ERRMODE</constant> is currently set. - </para> + </simpara> + </refsect1> + + <refsect1 role="changelog"> + &reftitle.changelog; + <informaltable> + <tgroup cols="2"> + <thead> + <row> + <entry>&Version;</entry> + <entry>&Description;</entry> + </row> + </thead> + <tbody> + <row> + <entry>8.5.0</entry> + <entry> + The <userinput>uri:</userinput> DSN scheme is now deprecated. + </entry> + </row> + </tbody> + </tgroup> + </informaltable> </refsect1> <refsect1 role="examples"> diff --git a/reference/pdo/pdostatement/fetchall.xml b/reference/pdo/pdostatement/fetchall.xml index 613113459fc3..5ea8eb5fb0d6 100644 --- a/reference/pdo/pdostatement/fetchall.xml +++ b/reference/pdo/pdostatement/fetchall.xml @@ -152,6 +152,17 @@ </row> </thead> <tbody> + <row> + <entry>8.5.0</entry> + <entry> + Using <constant>PDO::FETCH_INTO</constant> as a fetch mode now throws a + <exceptionname>ValueError</exceptionname>, similar to + <constant>PDO::FETCH_LAZY</constant>. + Using <constant>PDO::FETCH_PROPS_LATE</constant> with a fetch mode + other than <constant>PDO::FETCH_CLASS</constant> now throws a + <exceptionname>ValueError</exceptionname>. + </entry> + </row> <row> <entry>8.0.0</entry> <entry> diff --git a/reference/pdo/pdostatement/setattribute.xml b/reference/pdo/pdostatement/setattribute.xml index 611d6f3ca0c0..7b6af87dec71 100644 --- a/reference/pdo/pdostatement/setattribute.xml +++ b/reference/pdo/pdostatement/setattribute.xml @@ -64,6 +64,39 @@ </para> </refsect1> + <refsect1 role="errors"> + &reftitle.errors; + <simpara> + As of PHP 8.5.0, when using the Firebird driver, a + <exceptionname>ValueError</exceptionname> is thrown if the cursor name set via + <constant>PDO::ATTR_CURSOR_NAME</constant> is too long. + </simpara> + </refsect1> + + <refsect1 role="changelog"> + &reftitle.changelog; + <informaltable> + <tgroup cols="2"> + <thead> + <row> + <entry>&Version;</entry> + <entry>&Description;</entry> + </row> + </thead> + <tbody> + <row> + <entry>8.5.0</entry> + <entry> + When using the Firebird driver, a <exceptionname>ValueError</exceptionname> + is now thrown if the cursor name set via + <constant>PDO::ATTR_CURSOR_NAME</constant> is too long. + </entry> + </row> + </tbody> + </tgroup> + </informaltable> + </refsect1> + <refsect1 role="seealso"> &reftitle.seealso; <para> diff --git a/reference/pdo/pdostatement/setfetchmode.xml b/reference/pdo/pdostatement/setfetchmode.xml index cdce4e33ad30..04eb1cc63f34 100644 --- a/reference/pdo/pdostatement/setfetchmode.xml +++ b/reference/pdo/pdostatement/setfetchmode.xml @@ -69,7 +69,9 @@ <term><parameter>constructorArgs</parameter></term> <listitem> <simpara> - Constructor arguments. + Constructor arguments. As of PHP 8.5.0, string keys act as named + arguments. To pass a variable by reference, use a reference element: + <code>$constructorArgs = [&amp;$valByRef]</code>. </simpara> </listitem> </varlistentry> @@ -92,6 +94,16 @@ </simpara> </refsect1> + <refsect1 role="errors"> + &reftitle.errors; + <simpara> + As of PHP 8.5.0, an <exceptionname>Error</exceptionname> is thrown if this method + is called during a call to <methodname>PDOStatement::fetch</methodname>, + <methodname>PDOStatement::fetchObject</methodname>, or + <methodname>PDOStatement::fetchAll</methodname>. + </simpara> + </refsect1> + <refsect1 role="changelog"> &reftitle.changelog; <informaltable> @@ -103,6 +115,26 @@ </row> </thead> <tbody> + <row> + <entry>8.5.0</entry> + <entry> + The <parameter>constructorArgs</parameter> for + <constant>PDO::FETCH_CLASS</constant> now follow CUFA + (<function>call_user_func_array</function>) semantics: string keys act + as named arguments, and automatic wrapping of by-value arguments for + by-reference parameters has been removed. + </entry> + </row> + <row> + <entry>8.5.0</entry> + <entry> + Calling this method during a call to + <methodname>PDOStatement::fetch</methodname>, + <methodname>PDOStatement::fetchObject</methodname>, or + <methodname>PDOStatement::fetchAll</methodname> now throws an + <exceptionname>Error</exceptionname>. + </entry> + </row> &return.type.true.84; </tbody> </tgroup>

« previous php.doc.cvs (#23686) next »