php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #54692 SQLite3::open() Return Value
Submitted: 2011-05-08 23:14 UTC Modified: 2011-05-10 10:43 UTC
From: ostico at gmail dot com Assigned: aharvey (profile)
Status: Closed Package: SQLite related
PHP Version: Irrelevant OS: Ubuntu Server
Private report: No CVE-ID: None
 [2011-05-08 23:14 UTC] ostico at gmail dot com
Description:
------------
As the Php Reference said:

SQLite3::open

Returns TRUE on success, FALSE on failure to open the database.

But this IS NOT TRUE.

It Returns NULL.

Test script:
---------------
class testSQLite3 extends SQLite3{
     
    public function __construct(){
        var_dump( $this->open('test.sqlite3') );
    }
     
}
 
new testSQLite3();

Expected result:
----------------
//Create File 'test.sqlite3' And
//output
//bool(true)


Actual result:
--------------
//Create File 'test.sqlite3' And
//output
//NULL


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-05-10 08:51 UTC] scottmac@php.net
documentation is wrong, it returns void always. Exception on error
 [2011-05-10 10:10 UTC] aharvey@php.net
-Status: Open +Status: Assigned -Assigned To: +Assigned To: aharvey
 [2011-05-10 10:10 UTC] aharvey@php.net
Looks like the prototype comments are wrong in the actual source, too.
 [2011-05-10 10:14 UTC] aharvey@php.net
Automatic comment from SVN on behalf of aharvey
Revision: http://svn.php.net/viewvc/?view=revision&revision=310877
Log: Fix bug #54692 (SQLite3::open() Return Value) by correcting the SQLite3::open()
prototype.
 [2011-05-10 10:43 UTC] aharvey@php.net
-Status: Assigned +Status: Closed
 [2011-05-10 10:43 UTC] aharvey@php.net
This bug has been fixed in SVN.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.

Documentation and source updated.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Dec 06 06:01:29 2024 UTC