Doc->Bug #81576 [Ver->Fbk]: PDO::MYSQL_ATTR_INIT_COMMAND has int typehint, should be string
Edit report at https://bugs.php.net/bug.php?id=81576&edit=1
ID: 81576
Updated by: cmb@php.net
Reported by: matthias dot wirtz at hotmail dot de
Summary: PDO::MYSQL_ATTR_INIT_COMMAND has int typehint,
should be string
-Status: Verified
+Status: Feedback
-Type: Documentation Problem
+Type: Bug
Package: PDO MySQL
PHP Version: 8.1.0RC5
Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
The docs are fixed[1], but I cannot reproduce the reported error,
neither with strict_types nor when setting the attribute via
::setAttribute(). And the implementation doesn't look like this
error could be thrown. What am I missing?
[1] <https://github.com/php/doc-en/commit/b2379902aa98b534a21ad904b82c3f568c9efa32>
Previous Comments:
------------------------------------------------------------------------
[2021-11-03 10:09:46] cmb@php.net
Oh, right! Thanks for reporting.
------------------------------------------------------------------------
[2021-10-31 06:09:52] matthias dot wirtz at hotmail dot de
Description:
------------
https://www.php.net/manual/de/ref.pdo-mysql.php
PDO::MYSQL_ATTR_INIT_COMMAND (int) has a int typehint giving me this error in PHP 8.1:
Got error 'PHP message: PHP Fatal error: Uncaught TypeError: Attribute value must be of type
int for selected attribute, string given
Shouldn't the command be a string?
Test script:
---------------
new PDO(DB_CONN, DB_USER, DB_PASS, [PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES
utf8mb4']);
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=81576&edit=1
Thread (3 messages)