From:             kindaian at gmail dot com
Operating system: Windows XP Pro
PHP version:      5.2.5
PHP Bug Type:     dBase related
Bug description:  dbase_open exits with error

Description:
------------
I've a dbf with a problem in the array that holds the field definitions,
so when i try to open it it crashes.

I've tryed to open it in DBU and when i try to access the fields, it exits
with "BASE/1132 bound error: array access".

In PHP, it just exits with an error that it can't open the file and stops
execution ("Error reading DBF's number of fields").

The problem is that I've the code enclosed by a try/catch and the program
instead of gracefully execute the catch... just breaks.

Maybe related with the way error handling is handled inside the dbase
functions as pointed out also in the bug #37589 "dbase_open doesnt act like
it should" for another issue.

Reproduce code:
---------------
try {
        $dbf = @dbase_open($file_name, 0); 
} catch (Exception $e) {
        echo ("Error opening $file_name");
}

Expected result:
----------------
I was expecting that the program would print the error message and carry
on.

Actual result:
--------------
The execution just stops where the error happens, and no more code is
processed.

The error "Error reading DBF's number of fields" is shown in the browser.

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

Reply via email to