[doc-en] master: ext/pdo: PHP 8.4 changes across PDO, PDO_PGSQL and PDO_Firebird (#5703)
| From: | Louis-Arnaud via GitHub | Date: | Mon, 03 Aug 2026 10:42:27 +0000 |
| Subject: | [doc-en] master: ext/pdo: PHP 8.4 changes across PDO, PDO_PGSQL and PDO_Firebird (#5703) | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-23530@lists.php.net to get a copy of this message | ||
Author: Louis-Arnaud (lacatoire)
Committer: GitHub (web-flow)
Pusher: jordikroon
Date: 2026-08-03T12:42:24+02:00
Commit: https://github.com/php/doc-en/commit/371e92c3d8d9ee92542dfae4dee1d9fd0c940385
Raw diff: https://github.com/php/doc-en/commit/371e92c3d8d9ee92542dfae4dee1d9fd0c940385.diff
ext/pdo: PHP 8.4 changes across PDO, PDO_PGSQL and PDO_Firebird (#5703)
Co-authored-by: Kamil Tekiela <tekiela246@gmail.com>
Changed paths:
M reference/pdo/pdo/getattribute.xml
M reference/pdo/pdo/prepare.xml
M reference/pdo/pdostatement/getattribute.xml
M reference/pdo_firebird/configure.xml
M reference/pdo_pgsql/configure.xml
M reference/pdo_pgsql/pdo-pgsql.xml
M reference/pdo_pgsql/reference.xml
Diff:
diff --git a/reference/pdo/pdo/getattribute.xml b/reference/pdo/pdo/getattribute.xml
index eebbc93d3ae2..02acc2a65c38 100644
--- a/reference/pdo/pdo/getattribute.xml
+++ b/reference/pdo/pdo/getattribute.xml
@@ -38,18 +38,14 @@
One of the <literal>PDO::ATTR_*</literal> constants. The generic attributes that
apply to database connections are as follows:
<simplelist>
- <member><literal>PDO::ATTR_AUTOCOMMIT</literal></member>
<member><literal>PDO::ATTR_CASE</literal></member>
- <member><literal>PDO::ATTR_CLIENT_VERSION</literal></member>
- <member><literal>PDO::ATTR_CONNECTION_STATUS</literal></member>
+ <member><literal>PDO::ATTR_DEFAULT_FETCH_MODE</literal></member>
<member><literal>PDO::ATTR_DRIVER_NAME</literal></member>
<member><literal>PDO::ATTR_ERRMODE</literal></member>
<member><literal>PDO::ATTR_ORACLE_NULLS</literal></member>
<member><literal>PDO::ATTR_PERSISTENT</literal></member>
- <member><literal>PDO::ATTR_PREFETCH</literal></member>
- <member><literal>PDO::ATTR_SERVER_INFO</literal></member>
- <member><literal>PDO::ATTR_SERVER_VERSION</literal></member>
- <member><literal>PDO::ATTR_TIMEOUT</literal></member>
+ <member><literal>PDO::ATTR_STATEMENT_CLASS</literal></member>
+ <member><literal>PDO::ATTR_STRINGIFY_FETCHES</literal></member>
</simplelist>
</para>
<simpara>
diff --git a/reference/pdo/pdo/prepare.xml b/reference/pdo/pdo/prepare.xml
index 36d7b308a2c7..aadd5ff889e9 100644
--- a/reference/pdo/pdo/prepare.xml
+++ b/reference/pdo/pdo/prepare.xml
@@ -56,12 +56,12 @@
</para>
<note>
<simpara>
- The parser used for emulated prepared statements and for
- rewriting named or question mark style parameters supports the non standard
- backslash escapes for single- and double quotes. That means that terminating
- quotes immediately preceded by a backslash are not recognized as such, which
- may result in wrong detection of parameters causing the prepared statement to
- fail when it is executed. A work-around is to not use emulated prepares for
+ Before PHP 8.4.0, the parser used for emulated prepared statements and for
+ rewriting named or question mark style parameters supported the non standard
+ backslash escapes for single- and double quotes. That meant that terminating
+ quotes immediately preceded by a backslash were not recognized as such, which
+ could result in wrong detection of parameters causing the prepared statement to
+ fail when it was executed. A work-around was to not use emulated prepares for
such SQL queries, and to avoid rewriting of parameters by using a parameter style
which is natively supported by the driver.
</simpara>
@@ -71,6 +71,15 @@
the <literal>??</literal> string will be translated to
<literal>?</literal>
when sending the query to the database.
</para>
+ <simpara>
+ As of PHP 8.4.0, PDO uses driver-specific SQL parsers to locate parameter
+ markers, so that markers appearing inside string literals or comments are
+ not mistaken for placeholders. The default parser recognizes single- and
+ double-quoted string literals, as
+ well as two-dashes and non-nested C-style comments. Individual drivers may
+ provide a parser that recognizes additional or different syntax; refer to the
+ driver-specific documentation for details.
+ </simpara>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
diff --git a/reference/pdo/pdostatement/getattribute.xml
b/reference/pdo/pdostatement/getattribute.xml
index 7aec7c41e188..b875e6afbf20 100644
--- a/reference/pdo/pdostatement/getattribute.xml
+++ b/reference/pdo/pdostatement/getattribute.xml
@@ -24,6 +24,13 @@
Get the name of the cursor for <literal>UPDATE ... WHERE CURRENT OF</literal>.
</simpara>
</listitem>
+ <listitem>
+ <simpara>
+ <constant>Pdo\Pgsql::ATTR_RESULT_MEMORY_SIZE</constant>
+ (PostgreSQL specific, available as of PHP 8.4.0):
+ Get the amount of memory, in bytes, allocated to the query result.
+ </simpara>
+ </listitem>
</itemizedlist>
Note that driver specific attributes <emphasis>must not</emphasis> be used
with other drivers.
diff --git a/reference/pdo_firebird/configure.xml b/reference/pdo_firebird/configure.xml
index 6ef9611e5c25..653b14eeaf8a 100644
--- a/reference/pdo_firebird/configure.xml
+++ b/reference/pdo_firebird/configure.xml
@@ -12,6 +12,11 @@ $ ./configure --with-pdo-firebird
]]>
</screen>
</para>
+ <simpara>
+ As of PHP 8.4.0, this extension uses Firebird C++ APIs and therefore
+ requires a C++ compiler, and must be built against fbclient 3.0
+ or higher.
+ </simpara>
</section>
<!-- Keep this comment at the end of the file
diff --git a/reference/pdo_pgsql/configure.xml b/reference/pdo_pgsql/configure.xml
index b75737e09729..2871bfac93bc 100644
--- a/reference/pdo_pgsql/configure.xml
+++ b/reference/pdo_pgsql/configure.xml
@@ -12,6 +12,10 @@ $ ./configure --with-pdo-pgsql
]]>
</screen>
</para>
+ <simpara>
+ This extension requires libpq (the PostgreSQL C client library).
+ As of PHP 8.4.0, libpq 10.0 or later is required.
+ </simpara>
</section>
<!-- Keep this comment at the end of the file
diff --git a/reference/pdo_pgsql/pdo-pgsql.xml b/reference/pdo_pgsql/pdo-pgsql.xml
index aac12ca7f833..5888c54d7f76 100644
--- a/reference/pdo_pgsql/pdo-pgsql.xml
+++ b/reference/pdo_pgsql/pdo-pgsql.xml
@@ -44,6 +44,14 @@
</listitem>
</itemizedlist>
</para>
+ <note>
+ <simpara>
+ Because this parser recognizes dollar-quoted string literals, question
+ marks inside them are not treated as parameter placeholders and do not
+ need to be escaped. As of PHP 8.4.0, escaping question marks as
+ <literal>??</literal> inside a dollar-quoted string is deprecated.
+ </simpara>
+ </note>
</section>
<!-- }}} -->
diff --git a/reference/pdo_pgsql/reference.xml b/reference/pdo_pgsql/reference.xml
index dfc8d58f81aa..7006801fe634 100644
--- a/reference/pdo_pgsql/reference.xml
+++ b/reference/pdo_pgsql/reference.xml
@@ -119,6 +119,15 @@
</varlistentry>
</variablelist>
+ <note>
+ <simpara>
+ As of PHP 8.4.0, credentials specified in the DSN
+ (<literal>user</literal> and <literal>password</literal>) take
priority
+ over the corresponding arguments passed to the
+ <classname>PDO</classname> constructor. In earlier versions, the
+ PDO constructor arguments took precedence.
+ </simpara>
+ </note>
<note>
<simpara>
All semicolons in the DSN string are replaced by spaces, because PostgreSQL