[doc-en] master: Revert PDO constant types to int, document getAttribute() bool change
| From: | Jakub Vrana | Date: | Wed, 30 Sep 2026 19:26:19 +0000 |
| Subject: | [doc-en] master: Revert PDO constant types to int, document getAttribute() bool change | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-23797@lists.php.net to get a copy of this message | ||
Author: Jakub Vrana (vrana)
Date: 2026-09-30T21:20:06+02:00
Commit: https://github.com/php/doc-en/commit/00b118595a963f00211e96224e3fba35bdebc83c
Raw diff: https://github.com/php/doc-en/commit/00b118595a963f00211e96224e3fba35bdebc83c.diff
Revert PDO constant types to int, document getAttribute() bool change
The constants themselves are still int; PHP 8.4 changed the values
returned by getAttribute() for ATTR_AUTOCOMMIT (MySQL, Firebird) and
ATTR_EMULATE_PREPARES / MYSQL_ATTR_DIRECT_QUERY (MySQL) from int to
bool. The PDO_DBLIB attributes were already returned as bool before.
Follow-up to #5593.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Changed paths:
M reference/pdo/constants.xml
M reference/pdo/pdo/getattribute.xml
M reference/pdo_dblib/pdo-dblib.xml
M reference/pdo_mysql/constants.xml
Diff:
diff --git a/reference/pdo/constants.xml b/reference/pdo/constants.xml
index cb881bd27218..13daca5af956 100644
--- a/reference/pdo/constants.xml
+++ b/reference/pdo/constants.xml
@@ -226,17 +226,13 @@
<varlistentry xml:id="pdo.constants.attr-autocommit">
<term>
<constant>PDO::ATTR_AUTOCOMMIT</constant>
- (<type>bool</type>)
+ (<type>int</type>)
</term>
<listitem>
<simpara>
If this value is &false;, PDO attempts to disable autocommit so that the
connection begins a transaction.
</simpara>
- <simpara>
- As of PHP 8.4.0 this constant is typed as <type>bool</type>; previously,
- it was typed as <type>int</type>.
- </simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="pdo.constants.attr-prefetch">
@@ -498,19 +494,15 @@
<varlistentry xml:id="pdo.constants.attr-emulate-prepares">
<term>
<constant>PDO::ATTR_EMULATE_PREPARES</constant>
- (<type>bool</type>)
+ (<type>int</type>)
</term>
<listitem>
<simpara>
- Whether to enable or disable emulation of prepared statements. Some drivers
- either do not support native prepared statements or have only limited
- support for them. When set to &true;, PDO always emulates prepared
- statements; when set to &false;, it uses the driver's native prepared
- statements.
- </simpara>
- <simpara>
- As of PHP 8.4.0 this constant is typed as <type>bool</type>; previously,
- it was typed as <type>int</type>.
+ Whether to enable or disable emulation of prepared statements. Some drivers
+ either do not support native prepared statements or have only limited
+ support for them. When set to &true;, PDO always emulates prepared
+ statements; when set to &false;, it uses the driver's native prepared
+ statements.
</simpara>
</listitem>
</varlistentry>
diff --git a/reference/pdo/pdo/getattribute.xml b/reference/pdo/pdo/getattribute.xml
index 6ab7efbc7da0..d34db7d79821 100644
--- a/reference/pdo/pdo/getattribute.xml
+++ b/reference/pdo/pdo/getattribute.xml
@@ -93,6 +93,17 @@
<constant>PDO::ATTR_STRINGIFY_FETCHES</constant> attribute.
</entry>
</row>
+ <row>
+ <entry>8.4.0</entry>
+ <entry>
+ The value of <constant>PDO::ATTR_AUTOCOMMIT</constant> is now returned as
+ <type>bool</type> by the MySQL and Firebird drivers, and the value of
+ <constant>PDO::ATTR_EMULATE_PREPARES</constant> and
+ <constant>PDO::MYSQL_ATTR_DIRECT_QUERY</constant> is now returned as
+ <type>bool</type> by the MySQL driver; previously, they were returned as
+ <type>int</type>.
+ </entry>
+ </row>
</tbody>
</tgroup>
</informaltable>
diff --git a/reference/pdo_dblib/pdo-dblib.xml b/reference/pdo_dblib/pdo-dblib.xml
index 4f1d4b7f155f..2d6ec11963dc 100644
--- a/reference/pdo_dblib/pdo-dblib.xml
+++ b/reference/pdo_dblib/pdo-dblib.xml
@@ -50,7 +50,7 @@
<fieldsynopsis>
<modifier>public</modifier>
<modifier>const</modifier>
- <type>bool</type>
+ <type>int</type>
<varname
linkend="pdo-dblib.constants.attr-stringify-uniqueidentifier">Pdo\Dblib::ATTR_STRINGIFY_UNIQUEIDENTIFIER</varname>
</fieldsynopsis>
<fieldsynopsis>
@@ -74,7 +74,7 @@
<fieldsynopsis>
<modifier>public</modifier>
<modifier>const</modifier>
- <type>bool</type>
+ <type>int</type>
<varname
linkend="pdo-dblib.constants.attr-datetime-convert">Pdo\Dblib::ATTR_DATETIME_CONVERT</varname>
</fieldsynopsis>
@@ -108,8 +108,6 @@
<term><constant>Pdo\Dblib::ATTR_STRINGIFY_UNIQUEIDENTIFIER</constant></term>
<listitem>
<simpara>
- As of PHP 8.4.0 this constant is typed as <type>bool</type>; previously,
- it was typed as <type>int</type>.
</simpara>
</listitem>
</varlistentry>
@@ -146,10 +144,6 @@
format, as specified in the FreeTDS <filename>locales.conf</filename>
file. By default, this attribute is &false;.
</simpara>
- <simpara>
- As of PHP 8.4.0 this constant is typed as <type>bool</type>; previously,
- it was typed as <type>int</type>.
- </simpara>
</listitem>
</varlistentry>
</variablelist>
diff --git a/reference/pdo_mysql/constants.xml b/reference/pdo_mysql/constants.xml
index f85238051bf9..9b6224a19729 100644
--- a/reference/pdo_mysql/constants.xml
+++ b/reference/pdo_mysql/constants.xml
@@ -92,16 +92,12 @@
<varlistentry xml:id="pdo.constants.mysql-attr-direct-query">
<term>
<constant>PDO::MYSQL_ATTR_DIRECT_QUERY</constant>
- (<type>bool</type>)
+ (<type>int</type>)
</term>
<listitem>
<simpara>
&Alias; <constant>PDO::ATTR_EMULATE_PREPARES</constant>
</simpara>
- <simpara>
- As of PHP 8.4.0 this constant is typed as <type>bool</type>; previously,
- it was typed as <type>int</type>.
- </simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="pdo.constants.mysql-attr-found-rows">