From:             markus at fischer dot name
Operating system: Any
PHP version:      5.0.3
PHP Bug Type:     Filesystem function related
Bug description:  fgetcsv optional parameter length cannot be set to -1

Description:
------------
The default bahavior auf fgetcsv() is, if no parameter but the first is
given, that it automatically adjusts the buffer size when reading the
stream. Internally this is done by setting length to -1.

However, when you start to provide a custom delimiter or enclosure, you
also have to specify the length. It is not possible to set length to -1
(the C code prevents this), therefore the feature that the buffer adjusts
its size automatically cannot be used.

This is pretty much the same http://php.net/preg_split handles 
limit and flags parameter. If you want to specify "flags" but no "limit",
you set limit to -1.

This should be possible for fgetcsv() too.


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

Reply via email to