php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #37711 no access to error when extended class
Submitted: 2006-06-06 10:26 UTC Modified: 2006-06-06 10:30 UTC
From: lampacz at gmail dot com Assigned:
Status: Not a bug Package: MySQLi related
PHP Version: 5.1.4 OS: Debian
Private report: No CVE-ID: None
 [2006-06-06 10:26 UTC] lampacz at gmail dot com
Description:
------------
when extending class there is no access to parent::error, parent::errno

access to functions (query, set_charset, ...)works

Reproduce code:
---------------
class dbMYSQL extends mysqli {
...
function __construct(
parent::__construct($args....);
echo parent::errno;
echo parent::error;
}
...
}

Expected result:
----------------
0
''

or some error and error message when error occurs

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

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-06-06 10:30 UTC] tony2001@php.net
Apparently there are no such class constants.
If you want to access inherited properties - use $this->errno, this is what inheritance is about. 
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 08:01:28 2024 UTC