From:             coffy at bluecups dot net
Operating system: Linux
PHP version:      5.1.4
PHP Bug Type:     dBase related
Bug description:  dbase_open doesnt act like it should

Description:
------------
When you try to open(mode 0) not correct dbase file using dbase_open it
should return just FALSE according to
http://www.php.net/manual/en/function.dbase-open.php, instead it prints
"unable to get header" and "Warning: dbase_open(): unable to open
database".

Reproduce code:
---------------
code 1

<?php
        $db = dbase_open("ERR.DBF", 0); 
        dbase_close($db);
?>

code 2

<?php
        $db = @dbase_open("ERR.DBF", 0);
        @dbase_close($db);
?> 
 

Expected result:
----------------
No warning or "unable to get header", it should just return false
(according to currenct documentation). Even if the warning is right
behavior(and it's just missing from documentation), it still should be
possible to hide "unable to get header" using @.

Actual result:
--------------
Fill "ERR.DBF" with anything else than correct dbase info and you get the
"unable to get header" and "Warning ..." (code 1). Also it's not possible
to hide "unable to get header" message, code 2 is using @-s and it still
prints "unable to get header", when you dont use correct dbf file.

-- 
Edit bug report at http://bugs.php.net/?id=37589&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=37589&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=37589&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=37589&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=37589&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=37589&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=37589&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=37589&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=37589&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=37589&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=37589&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=37589&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=37589&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=37589&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=37589&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=37589&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=37589&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=37589&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=37589&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=37589&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=37589&r=mysqlcfg

Reply via email to