HEX
Server: Apache
System: Linux sg241.singhost.net 2.6.32-896.16.1.lve1.4.51.el6.x86_64 #1 SMP Wed Jan 17 13:19:23 EST 2018 x86_64
User: honghock (909)
PHP: 8.0.30
Disabled: passthru,system,shell_exec,show_source,exec,popen,proc_open
Upload Files
File: //opt/cloudlinux/alt-php54/root/usr/share/pear/test/File_CSV/tests/CSV/bug13332.phpt
--TEST--
File_CSV Test Case bug13332: Excel dump, wrong field count in parsing, bug status Bogus
--FILE--
<?php
// $Id: bug13332.phpt,v 1.1 2008/09/21 21:17:19 dufuz Exp $

require_once 'File/CSV.php';

$file = dirname(__FILE__) . '/bug13332.csv';
$conf = array(
    'fields' => 5,
    'sep'    => ',',
    'quote'  => '"',
    'header' => 0
);

$cvs = array();
while (($tmp = File_CSV::read($file, $conf)) !== false) {
    $csv[] = $tmp;
}

var_dump($csv);
?>
--EXPECT--
array(2) {
  [0]=>
  array(5) {
    [0]=>
    string(1) "1"
    [1]=>
    string(1) "2"
    [2]=>
    string(6) "Twenty"
    [3]=>
    string(35) "This is a test of a "quoted" value."
    [4]=>
    string(15) "There is no cow"
  }
  [1]=>
  array(5) {
    [0]=>
    string(1) "2"
    [1]=>
    string(1) "4"
    [2]=>
    string(5) "Forty"
    [3]=>
    string(37) "Another "quoted value", with a comma."
    [4]=>
    string(14) "There is a cow"
  }
}