php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #55859 mysqli->stat property access gives error
Submitted: 2011-10-06 10:26 UTC Modified: 2011-10-06 11:25 UTC
From: uw@php.net Assigned: andrey (profile)
Status: Closed Package: MySQLi related
PHP Version: 5.4SVN-2011-10-06 (SVN) OS:
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: uw@php.net
New email:
PHP Version: OS:

 

 [2011-10-06 10:26 UTC] uw@php.net
Description:
------------
 sapi/cli/php -r '$mysqli = new mysqli("localhost", "root", "", "test"); var_dump(mysqli_stat($mysqli)); var_dump($mysqli->stat);'
string(140) "Uptime: 2059747  Threads: 1  Questions: 126152  Slow queries: 0  Opens: 6377  Flush tables: 1  Open tables: 18  Queries per second avg: 0.61"
PHP Notice:  Undefined property: mysqli::$stat in Command line code on line 1
NULL

According to the docs there should be mysqli->stat, http://www.php.net/manual/en/mysqli.stat.php

Test script:
---------------
 sapi/cli/php -r '$mysqli = new mysqli("localhost", "root", "", "test"); var_dump(mysqli_stat($mysqli)); var_dump($mysqli->stat);'
string(140) "Uptime: 2059747  Threads: 1  Questions: 126152  Slow queries: 0  Opens: 6377  Flush tables: 1  Open tables: 18  Queries per second avg: 0.61"
PHP Notice:  Undefined property: mysqli::$stat in Command line code on line 1
NULL


Expected result:
----------------
Fix code or docs.


Patches

bug55859.diff (last revision 2011-10-06 11:22 UTC by johannes@php.net)

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-10-06 11:22 UTC] johannes@php.net
The following patch has been added/updated:

Patch Name: bug55859.diff
Revision:   1317900174
URL:        https://bugs.php.net/patch-display.php?bug=55859&patch=bug55859.diff&revision=1317900174
 [2011-10-06 11:24 UTC] andrey@php.net
Automatic comment from SVN on behalf of andrey
Revision: http://svn.php.net/viewvc/?view=revision&revision=317829
Log: Be consistent, add mysqli::stat property, as equivalent of mysqli_stat().
Fix for Bug #55859 mysqli->stat property access gives error
 [2011-10-06 11:25 UTC] andrey@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: andrey
 [2011-10-06 11:25 UTC] andrey@php.net
This bug has been fixed in SVN.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.

 For Windows:

http://windows.php.net/snapshots/
 
Thank you for the report, and for helping us make PHP better.

Thanks!Will be part of 5.3.9
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Oct 09 07:01:28 2024 UTC