ID:               46653
 User updated by:  s dot tretter at szene1 dot at
 Reported By:      s dot tretter at szene1 dot at
 Status:           Open
-Bug Type:         MySQLi related
+Bug Type:         Scripting Engine problem
 Operating System: linux
 PHP Version:      5.3CVS-2008-11-23 (CVS)
 New Comment:

i think this is a problem of the scirpting engine...


Previous Comments:
------------------------------------------------------------------------

[2008-11-23 12:59:07] s dot tretter at szene1 dot at

Description:
------------
If you extend a class with mysqli (using the mysqlnd driver) and try to
connect to the database, php produces strange error messages.
PHP 5.3.0alpha3-dev (cli) (built: Nov 23 2008 12:06:30) 
and --with-mysqli=mysqlnd

In php 5.2 and lower this test class works perfect.

Reproduce code:
---------------
<?php

class a extends mysqli
{
        public function __construct() {
                $dbParam = array ('DB_HOST' => 'localhost',
                                  'DB_USER' => 'db',
                                  'DB_PASS' => '',
                                  'DB_NAME' => 'test'
                                 );
                $this->init();
                $this->options(MYSQLI_OPT_CONNECT_TIMEOUT, 1);

                $this->real_connect(    $dbParam['DB_HOST'],
                                                       
$dbParam['DB_USER'],
                                                       
$dbParam['DB_PASS'],
                                                       
$dbParam['DB_NAME']);
        }
}


$mysqli = new a();
printf ("Connection: %s\n.", $mysqli->host_info);
$mysqli->close();
?>

Expected result:
----------------
should work like in php5.2

Actual result:
--------------
Warning: mysqli::options() [mysqli.options]: Couldn't fetch a in
test.php on line 31
Warning: mysqli::real_connect() [mysqli.real-connect]: Couldn't fetch
test.php on line 41


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=46653&edit=1

Reply via email to