|  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
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.
Block user comment
Status: Assign to:
Bug Type:
From: rgreene at pcpros dot net
New email:
PHP Version: OS:


 [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-2024 The PHP Group
All rights reserved.
Last updated: Sat Jun 15 18:01:30 2024 UTC