Dear
I have extended the class mysqli in php but when doing print_r
the public properties that I have added to the class are not shown:
here is an example:
<?php
// define una nueva clase
class miClase extends mysqli{
public $miPropiedad;
public $miOtraPropiedad;
public function __construct ( $host='localhost',$username='user',$passwd='1234',$dbname='base' ){
$this->miPropiedad = 'Hola';
parent::__construct ( $host,$username,$passwd,$dbname );
$this->miOtraPropiedad = 'Chao';
}
}// class
$miObjeto = new miClase();
echo $miObjeto->miPropiedad ,"\n"; // las nuevas propiedades son accesible
echo $miObjeto->miOtraPropiedad ,"\n";
print_r( $miObjeto ); // no muestra las nuevas propiedades
The output of this is:
Hola Chao miClase Object ( [affected_rows] => [client_info] => [client_version] => 50011 [connect_errno] => 1045 [connect_error] => Access denied for user 'user'@'localhost' (using password: YES) [errno] => [error] => [error_list] => [field_count] => [host_info] => [info] => [insert_id] => [server_info] => [server_version] => [stat] => [sqlstate] => [protocol_version] => [thread_id] => [warning_count] => )
I've tried rewriting __debugInfo()
but it's never called: (
Any ideas on how to make the added properties visible?
Thank you very much