Bug #64035 [Opn->Fbk]: In constructing \PDO an empty Fatal Error appears
| From: | mike@php.net | Date: | Tue, 20 Aug 2013 12:54:48 +0000 |
| Subject: | Bug #64035 [Opn->Fbk]: In constructing \PDO an empty Fatal Error appears | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-181045@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=64035&edit=1
ID: 64035
Updated by: mike@php.net
Reported by: lionishy at gmail dot com
Summary: In constructing \PDO an empty Fatal Error appears
-Status: Open
+Status: Feedback
Type: Bug
Package: PDO related
Operating System: Windows 8
PHP Version: 5.4.11
Block user comment: N
Private report: N
New Comment:
Please try using this snapshot:
http://snaps.php.net/php5.4-latest.tar.gz
For Windows:
http://windows.php.net/snapshots/
Cannot reproduce.
Previous Comments:
------------------------------------------------------------------------
[2013-01-21 11:14:08] lionishy at gmail dot com
Description:
------------
When I construct an object I expect an exception to be thrown when there's any
problem. Still, on Windows 8 I get the Fatal Error with no message, while
expecting Fatal Error: Uncaught Exception. Moreover, if \PDOException is caught
and any other type exception is thrown, normal Fatal Error: Uncaught Exception
<bla bla bla> appears.
Test script:
---------------
<?php
/**
* an empty Fatal Error appears
*/
$pdo = new \PDO('mysql:host=localhost;dbname=test','user','password');
/**
* an expected Fatal Error Uncaught Exception apperas
*/
try {
$pso = new
\PDO('mysql:host=localhost;dbname=test','user','password');
} catch(\PDOException $ex) {
throw new Exception('\PDO Exception\'s been caught!');
}
/**
* an empty Fatal Error appears again
*/
try {
$pso = new
\PDO('mysql:host=localhost;dbname=test','user','password');
} catch(\PDOException $ex) {
throw new Exception($ex->getMessage());
}
Expected result:
----------------
Fatal Error: Uncaught Exception '\PDOException' with message '<message goes
here>'
in test.php on line 5
Actual result:
--------------
Fatal Error: in test.php on line 5
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=64035&edit=1