|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #31754 dbase_open() fails for mode = 1
Submitted: 2005-01-29 21:41 UTC Modified: 2005-02-04 15:47 UTC
From: didou at keliglia dot com Assigned:
Status: Closed Package: dBase related
PHP Version: 4CVS, 5CVS (2005-02-01) OS: *
Private report: No CVE-ID: None
 [2005-01-29 21:41 UTC] didou at keliglia dot com
When opening a dbf file using dbase_open($file, 1), the call fails because it can't reads the header infos.

We can only open dbase files in read-only or read-write mode. Either it's an implementation or a documentation one.

If it's the intended behaviour, can you make it throw a warning more explicit ?

Thanks in advance,


Reproduce code:

$desc = array(
 array("foo", "C", 50),

$df = dbase_create("db.dbf", $desc);

var_dump(dbase_open('db.dbf', 1));


Expected result:

Actual result:
Unable to get header

Warning: unable to open database db.dbf in /home/didou/plop.php on line 11


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2005-02-03 19:17 UTC]
Here's a patch following Derick's suggestion. It triggers a warning and return false.

(test file included
 [2005-02-04 15:47 UTC]
This bug has been fixed in CVS.

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

PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 16 12:01:29 2024 UTC