Bug #81084 [NEW]: PDOStatement::queryString is uninitialized

From: Date: Wed, 26 May 2021 23:24:21 +0000
Subject: Bug #81084 [NEW]: PDOStatement::queryString is uninitialized
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-234035@lists.php.net to get a copy of this message
From:             corey dot taylor dot fl at gmail dot com
Operating system: 
PHP version:      master-Git-2021-05-26 (Git)
Package:          PDO Core
Bug Type:         Bug
Bug description:PDOStatement::queryString is uninitialized

Description:
------------
At some point in php 8.1 development, PDOStatement::queryString became a
typed property which throws an error when uninitialized.

https://www.php.net/manual/en/class.pdostatement.php

We were checking whether $queryString was truthy before using it, but
now that access throws an error.

https://3v4l.org/gHlc0/rfc#git.master

The property is documented as "readonly string" which implies that it is
always non-null.

Can we make it nullable or initialize it when PDOStatement is created?

The work around is using "isset($statement->queryString)" directly, but
doesn't seem like it should be uninitialized.


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


Thread (12 messages)

« previous php.bugs (#234035) next »