Bug #81576 [NEW]: PDO::MYSQL_ATTR_INIT_COMMAND has int typehint, should be string

From: Date: Sun, 31 Oct 2021 06:09:52 +0000
Subject: Bug #81576 [NEW]: PDO::MYSQL_ATTR_INIT_COMMAND has int typehint, should be string
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-237475@lists.php.net to get a copy of this message
From:             matthias dot wirtz at hotmail dot de
Operating system: 
PHP version:      8.1.0RC5
Package:          PDO MySQL
Bug Type:         Bug
Bug description:PDO::MYSQL_ATTR_INIT_COMMAND has int typehint, should be string

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 bug report at https://bugs.php.net/bug.php?id=81576&edit=1
-- 
Fix committed:                    https://bugs.php.net/fix.php?id=81576&r=fixed
Fixed in release:                 https://bugs.php.net/fix.php?id=81576&r=alreadyfixed
Need backtrace:                   https://bugs.php.net/fix.php?id=81576&r=needtrace
Need Reproduce Script:            https://bugs.php.net/fix.php?id=81576&r=needscript
Try newer version:                https://bugs.php.net/fix.php?id=81576&r=oldversion
Not developer issue:              https://bugs.php.net/fix.php?id=81576&r=support
Expected behavior:                https://bugs.php.net/fix.php?id=81576&r=notwrong
Not enough info:                  https://bugs.php.net/fix.php?id=81576&r=notenoughinfo
Submitted twice:                  https://bugs.php.net/fix.php?id=81576&r=submittedtwice
register_globals:                 https://bugs.php.net/fix.php?id=81576&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=81576&r=phptooold
Daylight Savings:                 https://bugs.php.net/fix.php?id=81576&r=dst
IIS Stability:                    https://bugs.php.net/fix.php?id=81576&r=isapi
Install GNU Sed:                  https://bugs.php.net/fix.php?id=81576&r=gnused
Floating point limitations:       https://bugs.php.net/fix.php?id=81576&r=float
No Zend Extensions:               https://bugs.php.net/fix.php?id=81576&r=nozend
MySQL Configuration Error:        https://bugs.php.net/fix.php?id=81576&r=mysqlcfg


Thread (3 messages)

« previous php.bugs (#237475) next »