|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #46494 no access to error when extended class
Submitted: 2008-11-05 10:58 UTC Modified: 2008-11-05 21:25 UTC
Avg. Score:3.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: Contact at LinuxIntro dot com Assigned:
Status: Not a bug Package: MySQLi related
PHP Version: 5.2.6 OS: Fedora
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
28 + 43 = ?
Subscribe to this entry?

 [2008-11-05 10:58 UTC] Contact at LinuxIntro dot com
I know that this is a 'no no', but i feel that the bug here was not bogus:

I disagree with the response. $this is used in the current class, whereas parent:: is used to access properties and methods of the parent class. errno and error are properties of the parent class, NOT of $this class. Using $this to access the property of parent:: is not inheritance, it is more closely related to symbiosis or polymorphism, or something. And besides, how is parent:: automatically giving $this new properties called errno and error? Shouldn't that only be done via a set/get type function? EX:

function GetErrno(){

function GetError(){

The fact that this is automatically available in the scope of $this is NOT inheritance, imho, it is a BUG.

Alex Grim

Reproduce code:
class dbMYSQL extends mysqli {
function __construct(
echo parent::errno;
echo parent::error;

Expected result:

or some error and error message when error occurs

Actual result:
Fatal error: Undefined class constant 'errno'
Fatal error: Undefined class constant 'error'


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2008-11-05 21:25 UTC]
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at and the instructions on how to report
a bug at

parent:: is for accessing the base implementation of a overwritten method, such a thing doesn't exist with properties.

Even if this would be a bug (what it isn't) it won't be a MySQLi issue.
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Sun May 28 13:03:46 2023 UTC