ID: 37419
Updated by: [EMAIL PROTECTED]
Reported By: suhachov at gmail dot com
-Status: Open
+Status: Bogus
Bug Type: Apache2 related
Operating System: *
PHP Version: 5.1.4
Assigned To: ilia
New Comment:
Actual result is not NULL, when instantiation of the PDO class
happens an exception is thrown.
Previous Comments:
------------------------------------------------------------------------
[2006-05-12 21:52:09] [EMAIL PROTECTED]
NULL is indeed wrong. If the costructor fails we have two options,
return an invalid object that cannot be used besides getting the error
information or we must throw an error. Ilia managed to allow delay of
base constructor call which allowed to drop final. Maybe he can check
whether we can get the above behavior using the error mode.
------------------------------------------------------------------------
[2006-05-12 14:34:28] suhachov at gmail dot com
I've solved this problem - MySQL extension wasn't loaded properly. But
I think this behavior is strange anyway - why don't to say "cannot
connect to MySQL"?
------------------------------------------------------------------------
[2006-05-12 14:20:11] suhachov at gmail dot com
Description:
------------
new PDO('mysql:host=localhost;db=test','test','test',array());
returns NULL under Apache2 and normal object under CLI.
Reproduce code:
---------------
<?
var_dump(
new PDO('mysql:host=localhost;db=test','test','test',array())
);
?>
and run this under Apache2 (my version is 2.0.55)
Expected result:
----------------
to get valid object
Actual result:
--------------
NULL
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=37419&edit=1