|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #46653 mysqlnd: can't extend mysqli
Submitted: 2008-11-23 12:59 UTC Modified: 2009-01-09 14:30 UTC
From: s dot tretter at szene1 dot at Assigned: mysql (profile)
Status: Closed Package: MySQLi related
PHP Version: 5.3CVS-2008-11-23 (CVS) 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: s dot tretter at szene1 dot at
New email:
PHP Version: OS:


 [2008-11-23 12:59 UTC] s dot tretter at szene1 dot at
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:

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

                $this->real_connect(    $dbParam['DB_HOST'],

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

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


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2008-11-25 09:27 UTC]
doesn't work with mysqli/libmysql (the same output)
 [2009-01-09 14:30 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-2022 The PHP Group
All rights reserved.
Last updated: Thu Aug 18 03:05:46 2022 UTC