ID: 40850 User updated by: serge dot dominici at e-sd dot org Reported By: serge dot dominici at e-sd dot org Status: Open Bug Type: MySQLi related Operating System: win32 PHP Version: 5.2.1 New Comment:
Sorry i have invert 'Expected result' and 'Actual result' Previous Comments: ------------------------------------------------------------------------ [2007-03-18 22:35:53] serge dot dominici at e-sd dot org Description: ------------ When creating the mysqli object, it don't return FALSE as said in the documentation, if the connection failed. Reproduce code: --------------- try { $this->mysqli = @new mysqli('localhost', 'bad_user', 'password', 'db'); if ($this->mysqli == FALSE) { throw new Exception("Connection failed !"); } var_dump($this->mysqli); var_export($this->mysqli); } catch (Exception $e) { $e->showStackTrace(); } Expected result: ---------------- object(mysqli)#5 (0) { } mysqli::__set_state(array( )) Actual result: -------------- Connection failed ! ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=40850&edit=1