Bug->Doc #81576 [Opn->Ver]: PDO::MYSQL_ATTR_INIT_COMMAND has int typehint, should be string

[email protected]
Newsgroups php.doc.bugs
Message-ID <[email protected]>
Edit report at https://bugs.php.net/bug.php?id=81576&edit=1

 ID:                 81576
 Updated by:         [email protected]
 Reported by:        matthias dot wirtz at hotmail dot de
 Summary:            PDO::MYSQL_ATTR_INIT_COMMAND has int typehint,
                     should be string
-Status:             Open
+Status:             Verified
-Type:               Bug
+Type:               Documentation Problem
 Package:            PDO MySQL
 PHP Version:        8.1.0RC5
-Assigned To:        
+Assigned To:        cmb
 Block user comment: N
 Private report:     N

 New Comment:

Oh, right!  Thanks for reporting.


Previous Comments:
------------------------------------------------------------------------
[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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.