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

From: Date: Wed, 03 Nov 2021 10:09:46 +0000
Subject: Bug->Doc #81576 [Opn->Ver]: PDO::MYSQL_ATTR_INIT_COMMAND has int typehint, should be string
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-19304@lists.php.net to get a copy of this message
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:             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


Thread (2 messages)

« previous php.doc.bugs (#19304) next »