|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #443 Unable to operate on dBase and standard file simultaneously.
Submitted: 1998-06-07 19:08 UTC Modified: 1998-10-10 19:22 UTC
Avg. Score:3.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: rgreene at pcpros dot net Assigned:
Status: Closed Package: dBase related
PHP Version: 3.0 Final Release OS: RH Linux 4.2 (2.0.30 kernel)
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 !
Your email address:
Solve the problem:
30 + 8 = ?
Subscribe to this entry?

 [1998-06-07 19:08 UTC] rgreene at pcpros dot net
Apparantly, the dBase and regular file functions are colliding on the file identifier assigned? 
$db is the dBase file id where $FILE is the file id.

Comment out the dbase_open line and all is well.

<b>Warning</b>:  Unable to find file identifier 1 in <b>./asd</b> on line <b>7</

#!/usr/local/bin/php -q
    $db= dbase_open("master.dbf", 0) ||
                die("Couldn't open dBase file: $filename\n");
    $FILE= fopen("junkfile", "w") || die("Could not create junkfile.\n");
    fwrite($FILE, "hi\n");


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [1998-10-10 19:22 UTC] jim
This is a tricky one -- the result of the || operator is always a boolean value. This means
    $test = "foo" || 5;
results in $test == 1.

In your example, this means that $db and $FILE are getting set to 1, not the return values of
the fopen() and dbase_open() functions.

PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Sat Jan 22 16:03:35 2022 UTC