Annotation of embedaddon/php/ext/standard/tests/file/fgetcsv_variation7.phpt, revision 1.1.1.2

1.1       misho       1: --TEST--
                      2: Test fgetcsv() : usage variations - with default arguments value
                      3: --FILE--
                      4: <?php
                      5: /* 
                      6:  Prototype: array fgetcsv ( resource $handle [, int $length [, string $delimiter [, string $enclosure]]] );
                      7:  Description: Gets line from file pointer and parse for CSV fields
                      8: */
                      9: 
                     10: /* Testing fgetcsv() to read from a file when provided with default value of arguments */
                     11: 
                     12: echo "*** Testing fgetcsv() : with default arguments value ***\n";
                     13: 
                     14: /* the array is with three elements in it. Each element should be read as 
                     15:    1st element is delimiter, 2nd element is enclosure 
                     16:    and 3rd element is csv fields
                     17: */
                     18: $csv_lists = array (
                     19:   array(',', '"', '"water",fruit'),
                     20:   array(',', '"', '"water","fruit"'),
                     21:   array(' ', '^', '^water^ ^fruit^'),
                     22:   array(':', '&', '&water&:&fruit&'),
                     23:   array('=', '=', '=water===fruit='),
                     24:   array('-', '-', '-water--fruit-air'),
                     25:   array('-', '-', '-water---fruit---air-'),
                     26:   array(':', '&', '&""""&:&"&:,:":&,&:,,,,')
                     27: );
                     28: 
                     29: $filename = dirname(__FILE__) . '/fgetcsv_variation7.tmp';
                     30: @unlink($filename);
                     31: 
                     32: $file_modes = array ("r","rb", "rt", "r+", "r+b", "r+t",
                     33:                      "a+", "a+b", "a+t",
                     34:                      "w+", "w+b", "w+t",
                     35:                      "x+", "x+b", "x+t"); 
                     36: 
                     37: $loop_counter = 1;
                     38: foreach ($csv_lists as $csv_list) {
                     39:   for($mode_counter = 0; $mode_counter < count($file_modes); $mode_counter++) {
                     40:     // create the file and add the content with has csv fields
                     41:     if ( strstr($file_modes[$mode_counter], "r") ) {
                     42:       $file_handle = fopen($filename, "w");
                     43:     } else {
                     44:       $file_handle = fopen($filename, $file_modes[$mode_counter] );
                     45:     }
                     46:     if ( !$file_handle ) {
                     47:       echo "Error: failed to create file $filename!\n";
                     48:       exit();
                     49:     }
                     50:     $delimiter = $csv_list[0];
                     51:     $enclosure = $csv_list[1];
                     52:     $csv_field = $csv_list[2];
                     53:     fwrite($file_handle, $csv_field . "\n");
                     54:     // write another line of text and a blank line
                     55:     // this will be used to test, if the fgetcsv() read more than a line and its
                     56:     // working when only a blank line is read
                     57:     fwrite($file_handle, "This is line of text without csv fields\n");
                     58:     fwrite($file_handle, "\n"); // blank line
                     59: 
                     60:     // close the file if the mode to be used is read mode  and re-open using read mode
1.1.1.2 ! misho      61:     // else rewind the file pointer to beginning of the file 
1.1       misho      62:     if ( strstr($file_modes[$mode_counter], "r" ) ) {
                     63:       fclose($file_handle);
                     64:       $file_handle = fopen($filename, $file_modes[$mode_counter]);
                     65:     } else {
                     66:       // rewind the file pointer to bof
                     67:       rewind($file_handle);
                     68:     }
                     69:       
                     70:     echo "\n-- Testing fgetcsv() with file opened using $file_modes[$mode_counter] mode --\n"; 
                     71: 
                     72:     // call fgetcsv() to parse csv fields
                     73: 
                     74:     // use only default arguments 
                     75:     fseek($file_handle, 0, SEEK_SET);
                     76:     var_dump( fgetcsv($file_handle) );
                     77:     // check the file pointer position and if eof
                     78:     var_dump( ftell($file_handle) );
                     79:     var_dump( feof($file_handle) );
                     80: 
                     81:     // close the file
                     82:     fclose($file_handle);
                     83:     //delete file
                     84:     unlink($filename);
                     85:   } //end of mode loop 
                     86: } // end of foreach
                     87: 
                     88: echo "Done\n";
                     89: ?>
                     90: --EXPECT--
                     91: *** Testing fgetcsv() : with default arguments value ***
                     92: 
                     93: -- Testing fgetcsv() with file opened using r mode --
                     94: array(2) {
                     95:   [0]=>
                     96:   string(5) "water"
                     97:   [1]=>
                     98:   string(5) "fruit"
                     99: }
                    100: int(14)
                    101: bool(false)
                    102: 
                    103: -- Testing fgetcsv() with file opened using rb mode --
                    104: array(2) {
                    105:   [0]=>
                    106:   string(5) "water"
                    107:   [1]=>
                    108:   string(5) "fruit"
                    109: }
                    110: int(14)
                    111: bool(false)
                    112: 
                    113: -- Testing fgetcsv() with file opened using rt mode --
                    114: array(2) {
                    115:   [0]=>
                    116:   string(5) "water"
                    117:   [1]=>
                    118:   string(5) "fruit"
                    119: }
                    120: int(14)
                    121: bool(false)
                    122: 
                    123: -- Testing fgetcsv() with file opened using r+ mode --
                    124: array(2) {
                    125:   [0]=>
                    126:   string(5) "water"
                    127:   [1]=>
                    128:   string(5) "fruit"
                    129: }
                    130: int(14)
                    131: bool(false)
                    132: 
                    133: -- Testing fgetcsv() with file opened using r+b mode --
                    134: array(2) {
                    135:   [0]=>
                    136:   string(5) "water"
                    137:   [1]=>
                    138:   string(5) "fruit"
                    139: }
                    140: int(14)
                    141: bool(false)
                    142: 
                    143: -- Testing fgetcsv() with file opened using r+t mode --
                    144: array(2) {
                    145:   [0]=>
                    146:   string(5) "water"
                    147:   [1]=>
                    148:   string(5) "fruit"
                    149: }
                    150: int(14)
                    151: bool(false)
                    152: 
                    153: -- Testing fgetcsv() with file opened using a+ mode --
                    154: array(2) {
                    155:   [0]=>
                    156:   string(5) "water"
                    157:   [1]=>
                    158:   string(5) "fruit"
                    159: }
                    160: int(14)
                    161: bool(false)
                    162: 
                    163: -- Testing fgetcsv() with file opened using a+b mode --
                    164: array(2) {
                    165:   [0]=>
                    166:   string(5) "water"
                    167:   [1]=>
                    168:   string(5) "fruit"
                    169: }
                    170: int(14)
                    171: bool(false)
                    172: 
                    173: -- Testing fgetcsv() with file opened using a+t mode --
                    174: array(2) {
                    175:   [0]=>
                    176:   string(5) "water"
                    177:   [1]=>
                    178:   string(5) "fruit"
                    179: }
                    180: int(14)
                    181: bool(false)
                    182: 
                    183: -- Testing fgetcsv() with file opened using w+ mode --
                    184: array(2) {
                    185:   [0]=>
                    186:   string(5) "water"
                    187:   [1]=>
                    188:   string(5) "fruit"
                    189: }
                    190: int(14)
                    191: bool(false)
                    192: 
                    193: -- Testing fgetcsv() with file opened using w+b mode --
                    194: array(2) {
                    195:   [0]=>
                    196:   string(5) "water"
                    197:   [1]=>
                    198:   string(5) "fruit"
                    199: }
                    200: int(14)
                    201: bool(false)
                    202: 
                    203: -- Testing fgetcsv() with file opened using w+t mode --
                    204: array(2) {
                    205:   [0]=>
                    206:   string(5) "water"
                    207:   [1]=>
                    208:   string(5) "fruit"
                    209: }
                    210: int(14)
                    211: bool(false)
                    212: 
                    213: -- Testing fgetcsv() with file opened using x+ mode --
                    214: array(2) {
                    215:   [0]=>
                    216:   string(5) "water"
                    217:   [1]=>
                    218:   string(5) "fruit"
                    219: }
                    220: int(14)
                    221: bool(false)
                    222: 
                    223: -- Testing fgetcsv() with file opened using x+b mode --
                    224: array(2) {
                    225:   [0]=>
                    226:   string(5) "water"
                    227:   [1]=>
                    228:   string(5) "fruit"
                    229: }
                    230: int(14)
                    231: bool(false)
                    232: 
                    233: -- Testing fgetcsv() with file opened using x+t mode --
                    234: array(2) {
                    235:   [0]=>
                    236:   string(5) "water"
                    237:   [1]=>
                    238:   string(5) "fruit"
                    239: }
                    240: int(14)
                    241: bool(false)
                    242: 
                    243: -- Testing fgetcsv() with file opened using r mode --
                    244: array(2) {
                    245:   [0]=>
                    246:   string(5) "water"
                    247:   [1]=>
                    248:   string(5) "fruit"
                    249: }
                    250: int(16)
                    251: bool(false)
                    252: 
                    253: -- Testing fgetcsv() with file opened using rb mode --
                    254: array(2) {
                    255:   [0]=>
                    256:   string(5) "water"
                    257:   [1]=>
                    258:   string(5) "fruit"
                    259: }
                    260: int(16)
                    261: bool(false)
                    262: 
                    263: -- Testing fgetcsv() with file opened using rt mode --
                    264: array(2) {
                    265:   [0]=>
                    266:   string(5) "water"
                    267:   [1]=>
                    268:   string(5) "fruit"
                    269: }
                    270: int(16)
                    271: bool(false)
                    272: 
                    273: -- Testing fgetcsv() with file opened using r+ mode --
                    274: array(2) {
                    275:   [0]=>
                    276:   string(5) "water"
                    277:   [1]=>
                    278:   string(5) "fruit"
                    279: }
                    280: int(16)
                    281: bool(false)
                    282: 
                    283: -- Testing fgetcsv() with file opened using r+b mode --
                    284: array(2) {
                    285:   [0]=>
                    286:   string(5) "water"
                    287:   [1]=>
                    288:   string(5) "fruit"
                    289: }
                    290: int(16)
                    291: bool(false)
                    292: 
                    293: -- Testing fgetcsv() with file opened using r+t mode --
                    294: array(2) {
                    295:   [0]=>
                    296:   string(5) "water"
                    297:   [1]=>
                    298:   string(5) "fruit"
                    299: }
                    300: int(16)
                    301: bool(false)
                    302: 
                    303: -- Testing fgetcsv() with file opened using a+ mode --
                    304: array(2) {
                    305:   [0]=>
                    306:   string(5) "water"
                    307:   [1]=>
                    308:   string(5) "fruit"
                    309: }
                    310: int(16)
                    311: bool(false)
                    312: 
                    313: -- Testing fgetcsv() with file opened using a+b mode --
                    314: array(2) {
                    315:   [0]=>
                    316:   string(5) "water"
                    317:   [1]=>
                    318:   string(5) "fruit"
                    319: }
                    320: int(16)
                    321: bool(false)
                    322: 
                    323: -- Testing fgetcsv() with file opened using a+t mode --
                    324: array(2) {
                    325:   [0]=>
                    326:   string(5) "water"
                    327:   [1]=>
                    328:   string(5) "fruit"
                    329: }
                    330: int(16)
                    331: bool(false)
                    332: 
                    333: -- Testing fgetcsv() with file opened using w+ mode --
                    334: array(2) {
                    335:   [0]=>
                    336:   string(5) "water"
                    337:   [1]=>
                    338:   string(5) "fruit"
                    339: }
                    340: int(16)
                    341: bool(false)
                    342: 
                    343: -- Testing fgetcsv() with file opened using w+b mode --
                    344: array(2) {
                    345:   [0]=>
                    346:   string(5) "water"
                    347:   [1]=>
                    348:   string(5) "fruit"
                    349: }
                    350: int(16)
                    351: bool(false)
                    352: 
                    353: -- Testing fgetcsv() with file opened using w+t mode --
                    354: array(2) {
                    355:   [0]=>
                    356:   string(5) "water"
                    357:   [1]=>
                    358:   string(5) "fruit"
                    359: }
                    360: int(16)
                    361: bool(false)
                    362: 
                    363: -- Testing fgetcsv() with file opened using x+ mode --
                    364: array(2) {
                    365:   [0]=>
                    366:   string(5) "water"
                    367:   [1]=>
                    368:   string(5) "fruit"
                    369: }
                    370: int(16)
                    371: bool(false)
                    372: 
                    373: -- Testing fgetcsv() with file opened using x+b mode --
                    374: array(2) {
                    375:   [0]=>
                    376:   string(5) "water"
                    377:   [1]=>
                    378:   string(5) "fruit"
                    379: }
                    380: int(16)
                    381: bool(false)
                    382: 
                    383: -- Testing fgetcsv() with file opened using x+t mode --
                    384: array(2) {
                    385:   [0]=>
                    386:   string(5) "water"
                    387:   [1]=>
                    388:   string(5) "fruit"
                    389: }
                    390: int(16)
                    391: bool(false)
                    392: 
                    393: -- Testing fgetcsv() with file opened using r mode --
                    394: array(1) {
                    395:   [0]=>
                    396:   string(15) "^water^ ^fruit^"
                    397: }
                    398: int(16)
                    399: bool(false)
                    400: 
                    401: -- Testing fgetcsv() with file opened using rb mode --
                    402: array(1) {
                    403:   [0]=>
                    404:   string(15) "^water^ ^fruit^"
                    405: }
                    406: int(16)
                    407: bool(false)
                    408: 
                    409: -- Testing fgetcsv() with file opened using rt mode --
                    410: array(1) {
                    411:   [0]=>
                    412:   string(15) "^water^ ^fruit^"
                    413: }
                    414: int(16)
                    415: bool(false)
                    416: 
                    417: -- Testing fgetcsv() with file opened using r+ mode --
                    418: array(1) {
                    419:   [0]=>
                    420:   string(15) "^water^ ^fruit^"
                    421: }
                    422: int(16)
                    423: bool(false)
                    424: 
                    425: -- Testing fgetcsv() with file opened using r+b mode --
                    426: array(1) {
                    427:   [0]=>
                    428:   string(15) "^water^ ^fruit^"
                    429: }
                    430: int(16)
                    431: bool(false)
                    432: 
                    433: -- Testing fgetcsv() with file opened using r+t mode --
                    434: array(1) {
                    435:   [0]=>
                    436:   string(15) "^water^ ^fruit^"
                    437: }
                    438: int(16)
                    439: bool(false)
                    440: 
                    441: -- Testing fgetcsv() with file opened using a+ mode --
                    442: array(1) {
                    443:   [0]=>
                    444:   string(15) "^water^ ^fruit^"
                    445: }
                    446: int(16)
                    447: bool(false)
                    448: 
                    449: -- Testing fgetcsv() with file opened using a+b mode --
                    450: array(1) {
                    451:   [0]=>
                    452:   string(15) "^water^ ^fruit^"
                    453: }
                    454: int(16)
                    455: bool(false)
                    456: 
                    457: -- Testing fgetcsv() with file opened using a+t mode --
                    458: array(1) {
                    459:   [0]=>
                    460:   string(15) "^water^ ^fruit^"
                    461: }
                    462: int(16)
                    463: bool(false)
                    464: 
                    465: -- Testing fgetcsv() with file opened using w+ mode --
                    466: array(1) {
                    467:   [0]=>
                    468:   string(15) "^water^ ^fruit^"
                    469: }
                    470: int(16)
                    471: bool(false)
                    472: 
                    473: -- Testing fgetcsv() with file opened using w+b mode --
                    474: array(1) {
                    475:   [0]=>
                    476:   string(15) "^water^ ^fruit^"
                    477: }
                    478: int(16)
                    479: bool(false)
                    480: 
                    481: -- Testing fgetcsv() with file opened using w+t mode --
                    482: array(1) {
                    483:   [0]=>
                    484:   string(15) "^water^ ^fruit^"
                    485: }
                    486: int(16)
                    487: bool(false)
                    488: 
                    489: -- Testing fgetcsv() with file opened using x+ mode --
                    490: array(1) {
                    491:   [0]=>
                    492:   string(15) "^water^ ^fruit^"
                    493: }
                    494: int(16)
                    495: bool(false)
                    496: 
                    497: -- Testing fgetcsv() with file opened using x+b mode --
                    498: array(1) {
                    499:   [0]=>
                    500:   string(15) "^water^ ^fruit^"
                    501: }
                    502: int(16)
                    503: bool(false)
                    504: 
                    505: -- Testing fgetcsv() with file opened using x+t mode --
                    506: array(1) {
                    507:   [0]=>
                    508:   string(15) "^water^ ^fruit^"
                    509: }
                    510: int(16)
                    511: bool(false)
                    512: 
                    513: -- Testing fgetcsv() with file opened using r mode --
                    514: array(1) {
                    515:   [0]=>
                    516:   string(15) "&water&:&fruit&"
                    517: }
                    518: int(16)
                    519: bool(false)
                    520: 
                    521: -- Testing fgetcsv() with file opened using rb mode --
                    522: array(1) {
                    523:   [0]=>
                    524:   string(15) "&water&:&fruit&"
                    525: }
                    526: int(16)
                    527: bool(false)
                    528: 
                    529: -- Testing fgetcsv() with file opened using rt mode --
                    530: array(1) {
                    531:   [0]=>
                    532:   string(15) "&water&:&fruit&"
                    533: }
                    534: int(16)
                    535: bool(false)
                    536: 
                    537: -- Testing fgetcsv() with file opened using r+ mode --
                    538: array(1) {
                    539:   [0]=>
                    540:   string(15) "&water&:&fruit&"
                    541: }
                    542: int(16)
                    543: bool(false)
                    544: 
                    545: -- Testing fgetcsv() with file opened using r+b mode --
                    546: array(1) {
                    547:   [0]=>
                    548:   string(15) "&water&:&fruit&"
                    549: }
                    550: int(16)
                    551: bool(false)
                    552: 
                    553: -- Testing fgetcsv() with file opened using r+t mode --
                    554: array(1) {
                    555:   [0]=>
                    556:   string(15) "&water&:&fruit&"
                    557: }
                    558: int(16)
                    559: bool(false)
                    560: 
                    561: -- Testing fgetcsv() with file opened using a+ mode --
                    562: array(1) {
                    563:   [0]=>
                    564:   string(15) "&water&:&fruit&"
                    565: }
                    566: int(16)
                    567: bool(false)
                    568: 
                    569: -- Testing fgetcsv() with file opened using a+b mode --
                    570: array(1) {
                    571:   [0]=>
                    572:   string(15) "&water&:&fruit&"
                    573: }
                    574: int(16)
                    575: bool(false)
                    576: 
                    577: -- Testing fgetcsv() with file opened using a+t mode --
                    578: array(1) {
                    579:   [0]=>
                    580:   string(15) "&water&:&fruit&"
                    581: }
                    582: int(16)
                    583: bool(false)
                    584: 
                    585: -- Testing fgetcsv() with file opened using w+ mode --
                    586: array(1) {
                    587:   [0]=>
                    588:   string(15) "&water&:&fruit&"
                    589: }
                    590: int(16)
                    591: bool(false)
                    592: 
                    593: -- Testing fgetcsv() with file opened using w+b mode --
                    594: array(1) {
                    595:   [0]=>
                    596:   string(15) "&water&:&fruit&"
                    597: }
                    598: int(16)
                    599: bool(false)
                    600: 
                    601: -- Testing fgetcsv() with file opened using w+t mode --
                    602: array(1) {
                    603:   [0]=>
                    604:   string(15) "&water&:&fruit&"
                    605: }
                    606: int(16)
                    607: bool(false)
                    608: 
                    609: -- Testing fgetcsv() with file opened using x+ mode --
                    610: array(1) {
                    611:   [0]=>
                    612:   string(15) "&water&:&fruit&"
                    613: }
                    614: int(16)
                    615: bool(false)
                    616: 
                    617: -- Testing fgetcsv() with file opened using x+b mode --
                    618: array(1) {
                    619:   [0]=>
                    620:   string(15) "&water&:&fruit&"
                    621: }
                    622: int(16)
                    623: bool(false)
                    624: 
                    625: -- Testing fgetcsv() with file opened using x+t mode --
                    626: array(1) {
                    627:   [0]=>
                    628:   string(15) "&water&:&fruit&"
                    629: }
                    630: int(16)
                    631: bool(false)
                    632: 
                    633: -- Testing fgetcsv() with file opened using r mode --
                    634: array(1) {
                    635:   [0]=>
                    636:   string(15) "=water===fruit="
                    637: }
                    638: int(16)
                    639: bool(false)
                    640: 
                    641: -- Testing fgetcsv() with file opened using rb mode --
                    642: array(1) {
                    643:   [0]=>
                    644:   string(15) "=water===fruit="
                    645: }
                    646: int(16)
                    647: bool(false)
                    648: 
                    649: -- Testing fgetcsv() with file opened using rt mode --
                    650: array(1) {
                    651:   [0]=>
                    652:   string(15) "=water===fruit="
                    653: }
                    654: int(16)
                    655: bool(false)
                    656: 
                    657: -- Testing fgetcsv() with file opened using r+ mode --
                    658: array(1) {
                    659:   [0]=>
                    660:   string(15) "=water===fruit="
                    661: }
                    662: int(16)
                    663: bool(false)
                    664: 
                    665: -- Testing fgetcsv() with file opened using r+b mode --
                    666: array(1) {
                    667:   [0]=>
                    668:   string(15) "=water===fruit="
                    669: }
                    670: int(16)
                    671: bool(false)
                    672: 
                    673: -- Testing fgetcsv() with file opened using r+t mode --
                    674: array(1) {
                    675:   [0]=>
                    676:   string(15) "=water===fruit="
                    677: }
                    678: int(16)
                    679: bool(false)
                    680: 
                    681: -- Testing fgetcsv() with file opened using a+ mode --
                    682: array(1) {
                    683:   [0]=>
                    684:   string(15) "=water===fruit="
                    685: }
                    686: int(16)
                    687: bool(false)
                    688: 
                    689: -- Testing fgetcsv() with file opened using a+b mode --
                    690: array(1) {
                    691:   [0]=>
                    692:   string(15) "=water===fruit="
                    693: }
                    694: int(16)
                    695: bool(false)
                    696: 
                    697: -- Testing fgetcsv() with file opened using a+t mode --
                    698: array(1) {
                    699:   [0]=>
                    700:   string(15) "=water===fruit="
                    701: }
                    702: int(16)
                    703: bool(false)
                    704: 
                    705: -- Testing fgetcsv() with file opened using w+ mode --
                    706: array(1) {
                    707:   [0]=>
                    708:   string(15) "=water===fruit="
                    709: }
                    710: int(16)
                    711: bool(false)
                    712: 
                    713: -- Testing fgetcsv() with file opened using w+b mode --
                    714: array(1) {
                    715:   [0]=>
                    716:   string(15) "=water===fruit="
                    717: }
                    718: int(16)
                    719: bool(false)
                    720: 
                    721: -- Testing fgetcsv() with file opened using w+t mode --
                    722: array(1) {
                    723:   [0]=>
                    724:   string(15) "=water===fruit="
                    725: }
                    726: int(16)
                    727: bool(false)
                    728: 
                    729: -- Testing fgetcsv() with file opened using x+ mode --
                    730: array(1) {
                    731:   [0]=>
                    732:   string(15) "=water===fruit="
                    733: }
                    734: int(16)
                    735: bool(false)
                    736: 
                    737: -- Testing fgetcsv() with file opened using x+b mode --
                    738: array(1) {
                    739:   [0]=>
                    740:   string(15) "=water===fruit="
                    741: }
                    742: int(16)
                    743: bool(false)
                    744: 
                    745: -- Testing fgetcsv() with file opened using x+t mode --
                    746: array(1) {
                    747:   [0]=>
                    748:   string(15) "=water===fruit="
                    749: }
                    750: int(16)
                    751: bool(false)
                    752: 
                    753: -- Testing fgetcsv() with file opened using r mode --
                    754: array(1) {
                    755:   [0]=>
                    756:   string(17) "-water--fruit-air"
                    757: }
                    758: int(18)
                    759: bool(false)
                    760: 
                    761: -- Testing fgetcsv() with file opened using rb mode --
                    762: array(1) {
                    763:   [0]=>
                    764:   string(17) "-water--fruit-air"
                    765: }
                    766: int(18)
                    767: bool(false)
                    768: 
                    769: -- Testing fgetcsv() with file opened using rt mode --
                    770: array(1) {
                    771:   [0]=>
                    772:   string(17) "-water--fruit-air"
                    773: }
                    774: int(18)
                    775: bool(false)
                    776: 
                    777: -- Testing fgetcsv() with file opened using r+ mode --
                    778: array(1) {
                    779:   [0]=>
                    780:   string(17) "-water--fruit-air"
                    781: }
                    782: int(18)
                    783: bool(false)
                    784: 
                    785: -- Testing fgetcsv() with file opened using r+b mode --
                    786: array(1) {
                    787:   [0]=>
                    788:   string(17) "-water--fruit-air"
                    789: }
                    790: int(18)
                    791: bool(false)
                    792: 
                    793: -- Testing fgetcsv() with file opened using r+t mode --
                    794: array(1) {
                    795:   [0]=>
                    796:   string(17) "-water--fruit-air"
                    797: }
                    798: int(18)
                    799: bool(false)
                    800: 
                    801: -- Testing fgetcsv() with file opened using a+ mode --
                    802: array(1) {
                    803:   [0]=>
                    804:   string(17) "-water--fruit-air"
                    805: }
                    806: int(18)
                    807: bool(false)
                    808: 
                    809: -- Testing fgetcsv() with file opened using a+b mode --
                    810: array(1) {
                    811:   [0]=>
                    812:   string(17) "-water--fruit-air"
                    813: }
                    814: int(18)
                    815: bool(false)
                    816: 
                    817: -- Testing fgetcsv() with file opened using a+t mode --
                    818: array(1) {
                    819:   [0]=>
                    820:   string(17) "-water--fruit-air"
                    821: }
                    822: int(18)
                    823: bool(false)
                    824: 
                    825: -- Testing fgetcsv() with file opened using w+ mode --
                    826: array(1) {
                    827:   [0]=>
                    828:   string(17) "-water--fruit-air"
                    829: }
                    830: int(18)
                    831: bool(false)
                    832: 
                    833: -- Testing fgetcsv() with file opened using w+b mode --
                    834: array(1) {
                    835:   [0]=>
                    836:   string(17) "-water--fruit-air"
                    837: }
                    838: int(18)
                    839: bool(false)
                    840: 
                    841: -- Testing fgetcsv() with file opened using w+t mode --
                    842: array(1) {
                    843:   [0]=>
                    844:   string(17) "-water--fruit-air"
                    845: }
                    846: int(18)
                    847: bool(false)
                    848: 
                    849: -- Testing fgetcsv() with file opened using x+ mode --
                    850: array(1) {
                    851:   [0]=>
                    852:   string(17) "-water--fruit-air"
                    853: }
                    854: int(18)
                    855: bool(false)
                    856: 
                    857: -- Testing fgetcsv() with file opened using x+b mode --
                    858: array(1) {
                    859:   [0]=>
                    860:   string(17) "-water--fruit-air"
                    861: }
                    862: int(18)
                    863: bool(false)
                    864: 
                    865: -- Testing fgetcsv() with file opened using x+t mode --
                    866: array(1) {
                    867:   [0]=>
                    868:   string(17) "-water--fruit-air"
                    869: }
                    870: int(18)
                    871: bool(false)
                    872: 
                    873: -- Testing fgetcsv() with file opened using r mode --
                    874: array(1) {
                    875:   [0]=>
                    876:   string(21) "-water---fruit---air-"
                    877: }
                    878: int(22)
                    879: bool(false)
                    880: 
                    881: -- Testing fgetcsv() with file opened using rb mode --
                    882: array(1) {
                    883:   [0]=>
                    884:   string(21) "-water---fruit---air-"
                    885: }
                    886: int(22)
                    887: bool(false)
                    888: 
                    889: -- Testing fgetcsv() with file opened using rt mode --
                    890: array(1) {
                    891:   [0]=>
                    892:   string(21) "-water---fruit---air-"
                    893: }
                    894: int(22)
                    895: bool(false)
                    896: 
                    897: -- Testing fgetcsv() with file opened using r+ mode --
                    898: array(1) {
                    899:   [0]=>
                    900:   string(21) "-water---fruit---air-"
                    901: }
                    902: int(22)
                    903: bool(false)
                    904: 
                    905: -- Testing fgetcsv() with file opened using r+b mode --
                    906: array(1) {
                    907:   [0]=>
                    908:   string(21) "-water---fruit---air-"
                    909: }
                    910: int(22)
                    911: bool(false)
                    912: 
                    913: -- Testing fgetcsv() with file opened using r+t mode --
                    914: array(1) {
                    915:   [0]=>
                    916:   string(21) "-water---fruit---air-"
                    917: }
                    918: int(22)
                    919: bool(false)
                    920: 
                    921: -- Testing fgetcsv() with file opened using a+ mode --
                    922: array(1) {
                    923:   [0]=>
                    924:   string(21) "-water---fruit---air-"
                    925: }
                    926: int(22)
                    927: bool(false)
                    928: 
                    929: -- Testing fgetcsv() with file opened using a+b mode --
                    930: array(1) {
                    931:   [0]=>
                    932:   string(21) "-water---fruit---air-"
                    933: }
                    934: int(22)
                    935: bool(false)
                    936: 
                    937: -- Testing fgetcsv() with file opened using a+t mode --
                    938: array(1) {
                    939:   [0]=>
                    940:   string(21) "-water---fruit---air-"
                    941: }
                    942: int(22)
                    943: bool(false)
                    944: 
                    945: -- Testing fgetcsv() with file opened using w+ mode --
                    946: array(1) {
                    947:   [0]=>
                    948:   string(21) "-water---fruit---air-"
                    949: }
                    950: int(22)
                    951: bool(false)
                    952: 
                    953: -- Testing fgetcsv() with file opened using w+b mode --
                    954: array(1) {
                    955:   [0]=>
                    956:   string(21) "-water---fruit---air-"
                    957: }
                    958: int(22)
                    959: bool(false)
                    960: 
                    961: -- Testing fgetcsv() with file opened using w+t mode --
                    962: array(1) {
                    963:   [0]=>
                    964:   string(21) "-water---fruit---air-"
                    965: }
                    966: int(22)
                    967: bool(false)
                    968: 
                    969: -- Testing fgetcsv() with file opened using x+ mode --
                    970: array(1) {
                    971:   [0]=>
                    972:   string(21) "-water---fruit---air-"
                    973: }
                    974: int(22)
                    975: bool(false)
                    976: 
                    977: -- Testing fgetcsv() with file opened using x+b mode --
                    978: array(1) {
                    979:   [0]=>
                    980:   string(21) "-water---fruit---air-"
                    981: }
                    982: int(22)
                    983: bool(false)
                    984: 
                    985: -- Testing fgetcsv() with file opened using x+t mode --
                    986: array(1) {
                    987:   [0]=>
                    988:   string(21) "-water---fruit---air-"
                    989: }
                    990: int(22)
                    991: bool(false)
                    992: 
                    993: -- Testing fgetcsv() with file opened using r mode --
                    994: array(7) {
                    995:   [0]=>
                    996:   string(11) "&""""&:&"&:"
                    997:   [1]=>
                    998:   string(4) ":":&"
                    999:   [2]=>
                   1000:   string(2) "&:"
                   1001:   [3]=>
                   1002:   string(0) ""
                   1003:   [4]=>
                   1004:   string(0) ""
                   1005:   [5]=>
                   1006:   string(0) ""
                   1007:   [6]=>
                   1008:   string(0) ""
                   1009: }
                   1010: int(24)
                   1011: bool(false)
                   1012: 
                   1013: -- Testing fgetcsv() with file opened using rb mode --
                   1014: array(7) {
                   1015:   [0]=>
                   1016:   string(11) "&""""&:&"&:"
                   1017:   [1]=>
                   1018:   string(4) ":":&"
                   1019:   [2]=>
                   1020:   string(2) "&:"
                   1021:   [3]=>
                   1022:   string(0) ""
                   1023:   [4]=>
                   1024:   string(0) ""
                   1025:   [5]=>
                   1026:   string(0) ""
                   1027:   [6]=>
                   1028:   string(0) ""
                   1029: }
                   1030: int(24)
                   1031: bool(false)
                   1032: 
                   1033: -- Testing fgetcsv() with file opened using rt mode --
                   1034: array(7) {
                   1035:   [0]=>
                   1036:   string(11) "&""""&:&"&:"
                   1037:   [1]=>
                   1038:   string(4) ":":&"
                   1039:   [2]=>
                   1040:   string(2) "&:"
                   1041:   [3]=>
                   1042:   string(0) ""
                   1043:   [4]=>
                   1044:   string(0) ""
                   1045:   [5]=>
                   1046:   string(0) ""
                   1047:   [6]=>
                   1048:   string(0) ""
                   1049: }
                   1050: int(24)
                   1051: bool(false)
                   1052: 
                   1053: -- Testing fgetcsv() with file opened using r+ mode --
                   1054: array(7) {
                   1055:   [0]=>
                   1056:   string(11) "&""""&:&"&:"
                   1057:   [1]=>
                   1058:   string(4) ":":&"
                   1059:   [2]=>
                   1060:   string(2) "&:"
                   1061:   [3]=>
                   1062:   string(0) ""
                   1063:   [4]=>
                   1064:   string(0) ""
                   1065:   [5]=>
                   1066:   string(0) ""
                   1067:   [6]=>
                   1068:   string(0) ""
                   1069: }
                   1070: int(24)
                   1071: bool(false)
                   1072: 
                   1073: -- Testing fgetcsv() with file opened using r+b mode --
                   1074: array(7) {
                   1075:   [0]=>
                   1076:   string(11) "&""""&:&"&:"
                   1077:   [1]=>
                   1078:   string(4) ":":&"
                   1079:   [2]=>
                   1080:   string(2) "&:"
                   1081:   [3]=>
                   1082:   string(0) ""
                   1083:   [4]=>
                   1084:   string(0) ""
                   1085:   [5]=>
                   1086:   string(0) ""
                   1087:   [6]=>
                   1088:   string(0) ""
                   1089: }
                   1090: int(24)
                   1091: bool(false)
                   1092: 
                   1093: -- Testing fgetcsv() with file opened using r+t mode --
                   1094: array(7) {
                   1095:   [0]=>
                   1096:   string(11) "&""""&:&"&:"
                   1097:   [1]=>
                   1098:   string(4) ":":&"
                   1099:   [2]=>
                   1100:   string(2) "&:"
                   1101:   [3]=>
                   1102:   string(0) ""
                   1103:   [4]=>
                   1104:   string(0) ""
                   1105:   [5]=>
                   1106:   string(0) ""
                   1107:   [6]=>
                   1108:   string(0) ""
                   1109: }
                   1110: int(24)
                   1111: bool(false)
                   1112: 
                   1113: -- Testing fgetcsv() with file opened using a+ mode --
                   1114: array(7) {
                   1115:   [0]=>
                   1116:   string(11) "&""""&:&"&:"
                   1117:   [1]=>
                   1118:   string(4) ":":&"
                   1119:   [2]=>
                   1120:   string(2) "&:"
                   1121:   [3]=>
                   1122:   string(0) ""
                   1123:   [4]=>
                   1124:   string(0) ""
                   1125:   [5]=>
                   1126:   string(0) ""
                   1127:   [6]=>
                   1128:   string(0) ""
                   1129: }
                   1130: int(24)
                   1131: bool(false)
                   1132: 
                   1133: -- Testing fgetcsv() with file opened using a+b mode --
                   1134: array(7) {
                   1135:   [0]=>
                   1136:   string(11) "&""""&:&"&:"
                   1137:   [1]=>
                   1138:   string(4) ":":&"
                   1139:   [2]=>
                   1140:   string(2) "&:"
                   1141:   [3]=>
                   1142:   string(0) ""
                   1143:   [4]=>
                   1144:   string(0) ""
                   1145:   [5]=>
                   1146:   string(0) ""
                   1147:   [6]=>
                   1148:   string(0) ""
                   1149: }
                   1150: int(24)
                   1151: bool(false)
                   1152: 
                   1153: -- Testing fgetcsv() with file opened using a+t mode --
                   1154: array(7) {
                   1155:   [0]=>
                   1156:   string(11) "&""""&:&"&:"
                   1157:   [1]=>
                   1158:   string(4) ":":&"
                   1159:   [2]=>
                   1160:   string(2) "&:"
                   1161:   [3]=>
                   1162:   string(0) ""
                   1163:   [4]=>
                   1164:   string(0) ""
                   1165:   [5]=>
                   1166:   string(0) ""
                   1167:   [6]=>
                   1168:   string(0) ""
                   1169: }
                   1170: int(24)
                   1171: bool(false)
                   1172: 
                   1173: -- Testing fgetcsv() with file opened using w+ mode --
                   1174: array(7) {
                   1175:   [0]=>
                   1176:   string(11) "&""""&:&"&:"
                   1177:   [1]=>
                   1178:   string(4) ":":&"
                   1179:   [2]=>
                   1180:   string(2) "&:"
                   1181:   [3]=>
                   1182:   string(0) ""
                   1183:   [4]=>
                   1184:   string(0) ""
                   1185:   [5]=>
                   1186:   string(0) ""
                   1187:   [6]=>
                   1188:   string(0) ""
                   1189: }
                   1190: int(24)
                   1191: bool(false)
                   1192: 
                   1193: -- Testing fgetcsv() with file opened using w+b mode --
                   1194: array(7) {
                   1195:   [0]=>
                   1196:   string(11) "&""""&:&"&:"
                   1197:   [1]=>
                   1198:   string(4) ":":&"
                   1199:   [2]=>
                   1200:   string(2) "&:"
                   1201:   [3]=>
                   1202:   string(0) ""
                   1203:   [4]=>
                   1204:   string(0) ""
                   1205:   [5]=>
                   1206:   string(0) ""
                   1207:   [6]=>
                   1208:   string(0) ""
                   1209: }
                   1210: int(24)
                   1211: bool(false)
                   1212: 
                   1213: -- Testing fgetcsv() with file opened using w+t mode --
                   1214: array(7) {
                   1215:   [0]=>
                   1216:   string(11) "&""""&:&"&:"
                   1217:   [1]=>
                   1218:   string(4) ":":&"
                   1219:   [2]=>
                   1220:   string(2) "&:"
                   1221:   [3]=>
                   1222:   string(0) ""
                   1223:   [4]=>
                   1224:   string(0) ""
                   1225:   [5]=>
                   1226:   string(0) ""
                   1227:   [6]=>
                   1228:   string(0) ""
                   1229: }
                   1230: int(24)
                   1231: bool(false)
                   1232: 
                   1233: -- Testing fgetcsv() with file opened using x+ mode --
                   1234: array(7) {
                   1235:   [0]=>
                   1236:   string(11) "&""""&:&"&:"
                   1237:   [1]=>
                   1238:   string(4) ":":&"
                   1239:   [2]=>
                   1240:   string(2) "&:"
                   1241:   [3]=>
                   1242:   string(0) ""
                   1243:   [4]=>
                   1244:   string(0) ""
                   1245:   [5]=>
                   1246:   string(0) ""
                   1247:   [6]=>
                   1248:   string(0) ""
                   1249: }
                   1250: int(24)
                   1251: bool(false)
                   1252: 
                   1253: -- Testing fgetcsv() with file opened using x+b mode --
                   1254: array(7) {
                   1255:   [0]=>
                   1256:   string(11) "&""""&:&"&:"
                   1257:   [1]=>
                   1258:   string(4) ":":&"
                   1259:   [2]=>
                   1260:   string(2) "&:"
                   1261:   [3]=>
                   1262:   string(0) ""
                   1263:   [4]=>
                   1264:   string(0) ""
                   1265:   [5]=>
                   1266:   string(0) ""
                   1267:   [6]=>
                   1268:   string(0) ""
                   1269: }
                   1270: int(24)
                   1271: bool(false)
                   1272: 
                   1273: -- Testing fgetcsv() with file opened using x+t mode --
                   1274: array(7) {
                   1275:   [0]=>
                   1276:   string(11) "&""""&:&"&:"
                   1277:   [1]=>
                   1278:   string(4) ":":&"
                   1279:   [2]=>
                   1280:   string(2) "&:"
                   1281:   [3]=>
                   1282:   string(0) ""
                   1283:   [4]=>
                   1284:   string(0) ""
                   1285:   [5]=>
                   1286:   string(0) ""
                   1287:   [6]=>
                   1288:   string(0) ""
                   1289: }
                   1290: int(24)
                   1291: bool(false)
                   1292: Done

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>