#47257 [Com]: SQLite3->__construct has no sane way to detect errors
| From: | crrodriguez at suse dot de | Date: | Sun, 01 Feb 2009 17:22:53 +0000 |
| Subject: | #47257 [Com]: SQLite3->__construct has no sane way to detect errors | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-133346@lists.php.net to get a copy of this message | ||
ID: 47257
Comment by: crrodriguez at suse dot de
Reported By: cellog@php.net
Status: Assigned
Bug Type: SQLite related
Operating System: n/a
PHP Version: 5.3.0beta1
Assigned To: scottmac
New Comment:
Exceptions only IMHO, it is a "new" OOP only extension, kinda odd that
it throws only notices on errors...
Previous Comments:
------------------------------------------------------------------------
[2009-01-31 19:22:22] cellog@php.net
Description:
------------
SQLite3->__construct does not indicate errors by anything other than an
E_NOTICE. This means we have to set a user error handler just to tell
whether or not this code succeeds:
<?php
$a = new SQLite3('/path/to/database.sqlite');
?>
the constructor should throw an exception, or provide an error string
parameter by reference like the SQLite object.
Reproduce code:
---------------
<?php
// run as non-root
$a = new SQLite3('/root/database.sqlite');
?>
Expected result:
----------------
exception
Actual result:
--------------
E_NOTICE error
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=47257&edit=1