php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #64035 In constructing \PDO an empty Fatal Error appears
Submitted: 2013-01-21 11:14 UTC Modified: 2013-10-15 11:54 UTC
Votes:2
Avg. Score:4.5 ± 0.5
Reproduced:2 of 2 (100.0%)
Same Version:0 (0.0%)
Same OS:1 (50.0%)
From: lionishy at gmail dot com Assigned:
Status: No Feedback Package: PDO related
PHP Version: 5.4.11 OS: Windows 8
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
8 + 26 = ?
Subscribe to this entry?

 
 [2013-01-21 11:14 UTC] 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

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-08-20 12:54 UTC] mike@php.net
-Status: Open +Status: Feedback
 [2013-08-20 12:54 UTC] mike@php.net
Please try using this snapshot:

  http://snaps.php.net/php5.4-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/

Cannot reproduce.
 [2013-10-15 11:54 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon May 13 21:01:31 2024 UTC