Bug #81084 [NEW]: PDOStatement::queryString is uninitialized
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)
- corey dot taylor dot fl at gmail dot com
- nikic@php.netBug #81084 [Opn]: PDOStatement::queryString is uninitialized
- corey dot taylor dot fl at gmail dot comBug #81084 [Com]: PDOStatement::queryString is uninitialized
- nikic@php.netBug #81084 [Opn]: PDOStatement::queryString is uninitialized
- corey dot taylor dot fl at gmail dot comBug #81084 [Com]: PDOStatement::queryString is uninitialized
- nikic@php.netBug #81084 [Opn]: PDOStatement::queryString is uninitialized
- corey dot taylor dot fl at gmail dot comBug #81084 [Com]: PDOStatement::queryString is uninitialized
- nikic@php.netBug #81084 [Opn]: PDOStatement::queryString is uninitialized
- corey dot taylor dot fl at gmail dot comBug #81084 [Com]: PDOStatement::queryString is uninitialized
- cmb@php.netBug #81084 [Opn]: PDOStatement::queryString is uninitialized
- corey dot taylor dot fl at gmail dot comBug #81084 [Com]: PDOStatement::queryString is uninitialized
- techblogdhxh at gmail dot comBug #81084 [Com]: PDOStatement::queryString is uninitialized