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
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: lionishy at gmail dot com
New email:
PHP Version: OS:

 

 [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 Apr 29 02:01:29 2024 UTC