Bug #78666 [NEW]: mysqli_options generates Warning on var_dump()
| From: | r at roze dot lv | Date: | Sat, 12 Oct 2019 19:16:51 +0000 |
| Subject: | Bug #78666 [NEW]: mysqli_options generates Warning on var_dump() | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-223187@lists.php.net to get a copy of this message | ||
From: r at roze dot lv
Operating system:
PHP version: 7.4.0RC3
Package: MySQLi related
Bug Type: Bug
Bug description:mysqli_options generates Warning on var_dump()
Description:
------------
A simple code:
<?php
$con = mysqli_init();
mysqli_options( $con, MYSQLI_OPT_CONNECT_TIMEOUT, 2);
var_dump($con);
or OOP style
<?php
$con = mysqli_init();
$con->options(MYSQLI_OPT_CONNECT_TIMEOUT, 2);
var_dump($con);
Generates multiple Warnings - Warning: var_dump(): Property access is
not allowed yet in [file] on line 4
I noticed this when running Xdebug with xdebug.collect_params=3
(https://bugs.xdebug.org/view.php?id=1714) but Derick pointed out it not
to be Xdebug rather than mysqli problem.
Is this expected?
While in a production code there probably won't be a var_dump() it makes
the development environment problematic and confusing.
The workaround for Xdebug is to use OOP style but var_dump() still
produces Warnings.
Test script:
---------------
php -r
'$con=mysqli_init();mysqli_options($con,MYSQLI_OPT_CONNECT_TIMEOUT,2);var_dump($con);'
Expected result:
----------------
No warning.
Actual result:
--------------
Warning: var_dump(): Property access is not allowed yet in Command line
code on line 1
Warning: var_dump(): Property access is not allowed yet in Command line
code on line 1
Warning: var_dump(): Property access is not allowed yet in Command line
code on line 1
Warning: var_dump(): Property access is not allowed yet in Command line
code on line 1
Warning: var_dump(): Property access is not allowed yet in Command line
code on line 1
Warning: var_dump(): Property access is not allowed yet in Command line
code on line 1
Warning: var_dump(): Property access is not allowed yet in Command line
code on line 1
Warning: var_dump(): Property access is not allowed yet in Command line
code on line 1
Warning: var_dump(): Property access is not allowed yet in Command line
code on line 1
Warning: var_dump(): Property access is not allowed yet in Command line
code on line 1
Warning: var_dump(): Property access is not allowed yet in Command line
code on line 1
Warning: var_dump(): Property access is not allowed yet in Command line
code on line 1
object(mysqli)#1 (18) {
["affected_rows"]=>
bool(false)
["client_info"]=>
string(16) "mysqlnd 7.4.0RC3"
["client_version"]=>
int(70400)
["connect_errno"]=>
int(0)
["connect_error"]=>
NULL
["errno"]=>
int(0)
["error"]=>
string(0) ""
["error_list"]=>
bool(false)
["field_count"]=>
bool(false)
["host_info"]=>
bool(false)
["info"]=>
bool(false)
["insert_id"]=>
bool(false)
["server_info"]=>
bool(false)
["server_version"]=>
bool(false)
["sqlstate"]=>
bool(false)
["protocol_version"]=>
bool(false)
["thread_id"]=>
bool(false)
["warning_count"]=>
bool(false)
}
--
Edit bug report at https://bugs.php.net/bug.php?id=78666&edit=1
--
Fix committed: https://bugs.php.net/fix.php?id=78666&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=78666&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=78666&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=78666&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=78666&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=78666&r=support
Expected behavior: https://bugs.php.net/fix.php?id=78666&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=78666&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=78666&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=78666&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=78666&r=phptooold
Daylight Savings: https://bugs.php.net/fix.php?id=78666&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=78666&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=78666&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=78666&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=78666&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=78666&r=mysqlcfg