Bug #81405 [NEW]: Values of PDO::PARAM_ constants have changed

From: Date: Wed, 01 Sep 2021 09:07:22 +0000
Subject: Bug #81405 [NEW]: Values of PDO::PARAM_ constants have changed
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-236203@lists.php.net to get a copy of this message
From:             me at derrabus dot de
Operating system: macOS 11.5
PHP version:      8.1.0beta3
Package:          PDO Core
Bug Type:         Bug
Bug description:Values of PDO::PARAM_ constants have changed

Description:
------------
While patching the test suites of Symfony and Doctrine for PHP 8.1, I
have discovered that the internal values of several PDO constants have
changed.

While I am aware that as a developer I should not rely on the value of
those constants but rather use them as-is, I am afraid that this change
might break existing application in interesting ways.

My assumption is that the actual values of those constants should not
matter much to PDO because they are used in switch-like constructs, but
I might be wrong here. Under my assumption, the change feels a bit
arbitrary and unnecessary.

In the interest of providing a smooth upgrade path from PHP 8.0 to 8.1
for everyone, I'd kindly ask to restore the listed constants to their
values from PHP 8.0.

Test script:
---------------
<?php

echo 'PDO::PARAM_NULL => ' . \PDO::PARAM_NULL . "\n";
echo 'PDO::PARAM_BOOL => ' . \PDO::PARAM_BOOL . "\n";
echo 'PDO::PARAM_INT => ' . \PDO::PARAM_INT . "\n";
echo 'PDO::PARAM_STR => ' . \PDO::PARAM_STR . "\n";
echo 'PDO::PARAM_LOB => ' . \PDO::PARAM_LOB . "\n";
echo 'PDO::PARAM_STMT => ' . \PDO::PARAM_STMT . "\n";

Expected result:
----------------
PDO::PARAM_NULL => 0
PDO::PARAM_BOOL => 5
PDO::PARAM_INT => 1
PDO::PARAM_STR => 2
PDO::PARAM_LOB => 3
PDO::PARAM_STMT => 4

Actual result:
--------------
PDO::PARAM_NULL => 0
PDO::PARAM_BOOL => 1
PDO::PARAM_INT => 2
PDO::PARAM_STR => 3
PDO::PARAM_LOB => 4
PDO::PARAM_STMT => 5

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


Thread (7 messages)

« previous php.bugs (#236203) next »