|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #30967 Extending a class that extends mysqli
Submitted: 2004-12-02 21:34 UTC Modified: 2004-12-03 08:58 UTC
From: rbro at hotmail dot com Assigned:
Status: Closed Package: MySQLi related
PHP Version: 5CVS-2004-12-02 (dev) OS: Linux
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 this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: rbro at hotmail dot com
New email:
PHP Version: OS:


 [2004-12-02 21:34 UTC] rbro at hotmail dot com
I'm running into a problem when trying to extend a class that extends mysqli.  I cannot access any of the properties.  This is related to bug 28430 except here I am extending the class one level further.

Reproduce code:

class a extends mysqli { }

class b extends a { }

$mysqli = new mysqli('localhost', 'username', 'password', 'db');
echo $mysqli->warning_count."\n";

$a = new a('localhost', 'username', 'password', 'db');
echo $a->warning_count."\n";

$b = new b('localhost', 'username', 'password', 'db');
echo $b->warning_count."\n";

Expected result:

Actual result:

Notice: Undefined property:  b::$warning_count in /var/www/html/test.php on line 15


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2004-12-03 08:58 UTC]
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
Thank you for the report, and for helping us make PHP better.

PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Sun Oct 01 11:01:24 2023 UTC