1--TEST--
2Test fgetcsv() : usage variations - with length less than line size
3--FILE--
4<?php
5/*
6  Testing fgetcsv() to read from a file when provided with the length argument
7  value less than the line size
8*/
9
10echo "*** Testing fgetcsv() : with length less than line size ***\n";
11
12/* the array is with three elements in it. Each element should be read as
13   1st element is delimiter, 2nd element is enclosure
14   and 3rd element is csv fields
15*/
16$csv_lists = array (
17  array(',', '"', '"water",fruit'),
18  array(',', '"', '"water","fruit"'),
19  array(' ', '^', '^water^ ^fruit^'),
20  array(':', '&', '&water&:&fruit&'),
21  array('=', '=', '=water===fruit='),
22  array('-', '-', '-water--fruit-air'),
23  array('-', '-', '-water---fruit---air-'),
24  array(':', '&', '&""""&:&"&:,:":&,&:,,,,')
25);
26
27$filename = __DIR__ . '/fgetcsv_variation6.tmp';
28@unlink($filename);
29
30$file_modes = array ("r","rb", "rt", "r+", "r+b", "r+t",
31                     "a+", "a+b", "a+t",
32                     "w+", "w+b", "w+t",
33                     "x+", "x+b", "x+t");
34
35$loop_counter = 1;
36foreach ($csv_lists as $csv_list) {
37  for($mode_counter = 0; $mode_counter < count($file_modes); $mode_counter++) {
38    // create the file and add the content with has csv fields
39    if ( strstr($file_modes[$mode_counter], "r") ) {
40      $file_handle = fopen($filename, "w");
41    } else {
42      $file_handle = fopen($filename, $file_modes[$mode_counter] );
43    }
44    if ( !$file_handle ) {
45      echo "Error: failed to create file $filename!\n";
46      exit();
47    }
48    $delimiter = $csv_list[0];
49    $enclosure = $csv_list[1];
50    $csv_field = $csv_list[2];
51    fwrite($file_handle, $csv_field . "\n");
52    // write another line of text and a blank line
53    // this will be used to test, if the fgetcsv() read more than a line and its
54    // working when only a blan line is read
55    fwrite($file_handle, "This is line of text without csv fields\n");
56    fwrite($file_handle, "\n"); // blank line
57
58    // close the file if the mode to be used is read mode  and re-open using read mode
59    // else rewind the file pointer to beginning of the file
60    if ( strstr($file_modes[$mode_counter], "r" ) ) {
61      fclose($file_handle);
62      $file_handle = fopen($filename, $file_modes[$mode_counter]);
63    } else {
64      // rewind the file pointer to bof
65      rewind($file_handle);
66    }
67
68    echo "\n-- Testing fgetcsv() with file opened using $file_modes[$mode_counter] mode --\n";
69
70    // call fgetcsv() to parse csv fields
71
72    // use length as less than the actual size of the line
73    fseek($file_handle, 0, SEEK_SET);
74    var_dump( fgetcsv($file_handle, 9, $delimiter, $enclosure) );
75    // check the file pointer position and if eof
76    var_dump( ftell($file_handle) );
77    var_dump( feof($file_handle) );
78    // read rest of the line
79    var_dump( fgetcsv($file_handle, 1024, $delimiter, $enclosure) );
80    // check the file pointer position and if eof
81    var_dump( ftell($file_handle) );
82    var_dump( feof($file_handle) );
83
84    // close the file
85    fclose($file_handle);
86    //delete file
87    unlink($filename);
88  } //end of mode loop
89} // end of foreach
90
91echo "Done\n";
92?>
93--EXPECT--
94*** Testing fgetcsv() : with length less than line size ***
95
96-- Testing fgetcsv() with file opened using r mode --
97array(2) {
98  [0]=>
99  string(5) "water"
100  [1]=>
101  string(1) "f"
102}
103int(9)
104bool(false)
105array(1) {
106  [0]=>
107  string(4) "ruit"
108}
109int(14)
110bool(false)
111
112-- Testing fgetcsv() with file opened using rb mode --
113array(2) {
114  [0]=>
115  string(5) "water"
116  [1]=>
117  string(1) "f"
118}
119int(9)
120bool(false)
121array(1) {
122  [0]=>
123  string(4) "ruit"
124}
125int(14)
126bool(false)
127
128-- Testing fgetcsv() with file opened using rt mode --
129array(2) {
130  [0]=>
131  string(5) "water"
132  [1]=>
133  string(1) "f"
134}
135int(9)
136bool(false)
137array(1) {
138  [0]=>
139  string(4) "ruit"
140}
141int(14)
142bool(false)
143
144-- Testing fgetcsv() with file opened using r+ mode --
145array(2) {
146  [0]=>
147  string(5) "water"
148  [1]=>
149  string(1) "f"
150}
151int(9)
152bool(false)
153array(1) {
154  [0]=>
155  string(4) "ruit"
156}
157int(14)
158bool(false)
159
160-- Testing fgetcsv() with file opened using r+b mode --
161array(2) {
162  [0]=>
163  string(5) "water"
164  [1]=>
165  string(1) "f"
166}
167int(9)
168bool(false)
169array(1) {
170  [0]=>
171  string(4) "ruit"
172}
173int(14)
174bool(false)
175
176-- Testing fgetcsv() with file opened using r+t mode --
177array(2) {
178  [0]=>
179  string(5) "water"
180  [1]=>
181  string(1) "f"
182}
183int(9)
184bool(false)
185array(1) {
186  [0]=>
187  string(4) "ruit"
188}
189int(14)
190bool(false)
191
192-- Testing fgetcsv() with file opened using a+ mode --
193array(2) {
194  [0]=>
195  string(5) "water"
196  [1]=>
197  string(1) "f"
198}
199int(9)
200bool(false)
201array(1) {
202  [0]=>
203  string(4) "ruit"
204}
205int(14)
206bool(false)
207
208-- Testing fgetcsv() with file opened using a+b mode --
209array(2) {
210  [0]=>
211  string(5) "water"
212  [1]=>
213  string(1) "f"
214}
215int(9)
216bool(false)
217array(1) {
218  [0]=>
219  string(4) "ruit"
220}
221int(14)
222bool(false)
223
224-- Testing fgetcsv() with file opened using a+t mode --
225array(2) {
226  [0]=>
227  string(5) "water"
228  [1]=>
229  string(1) "f"
230}
231int(9)
232bool(false)
233array(1) {
234  [0]=>
235  string(4) "ruit"
236}
237int(14)
238bool(false)
239
240-- Testing fgetcsv() with file opened using w+ mode --
241array(2) {
242  [0]=>
243  string(5) "water"
244  [1]=>
245  string(1) "f"
246}
247int(9)
248bool(false)
249array(1) {
250  [0]=>
251  string(4) "ruit"
252}
253int(14)
254bool(false)
255
256-- Testing fgetcsv() with file opened using w+b mode --
257array(2) {
258  [0]=>
259  string(5) "water"
260  [1]=>
261  string(1) "f"
262}
263int(9)
264bool(false)
265array(1) {
266  [0]=>
267  string(4) "ruit"
268}
269int(14)
270bool(false)
271
272-- Testing fgetcsv() with file opened using w+t mode --
273array(2) {
274  [0]=>
275  string(5) "water"
276  [1]=>
277  string(1) "f"
278}
279int(9)
280bool(false)
281array(1) {
282  [0]=>
283  string(4) "ruit"
284}
285int(14)
286bool(false)
287
288-- Testing fgetcsv() with file opened using x+ mode --
289array(2) {
290  [0]=>
291  string(5) "water"
292  [1]=>
293  string(1) "f"
294}
295int(9)
296bool(false)
297array(1) {
298  [0]=>
299  string(4) "ruit"
300}
301int(14)
302bool(false)
303
304-- Testing fgetcsv() with file opened using x+b mode --
305array(2) {
306  [0]=>
307  string(5) "water"
308  [1]=>
309  string(1) "f"
310}
311int(9)
312bool(false)
313array(1) {
314  [0]=>
315  string(4) "ruit"
316}
317int(14)
318bool(false)
319
320-- Testing fgetcsv() with file opened using x+t mode --
321array(2) {
322  [0]=>
323  string(5) "water"
324  [1]=>
325  string(1) "f"
326}
327int(9)
328bool(false)
329array(1) {
330  [0]=>
331  string(4) "ruit"
332}
333int(14)
334bool(false)
335
336-- Testing fgetcsv() with file opened using r mode --
337array(2) {
338  [0]=>
339  string(5) "water"
340  [1]=>
341  string(5) "fruit"
342}
343int(16)
344bool(false)
345array(1) {
346  [0]=>
347  string(39) "This is line of text without csv fields"
348}
349int(56)
350bool(false)
351
352-- Testing fgetcsv() with file opened using rb mode --
353array(2) {
354  [0]=>
355  string(5) "water"
356  [1]=>
357  string(5) "fruit"
358}
359int(16)
360bool(false)
361array(1) {
362  [0]=>
363  string(39) "This is line of text without csv fields"
364}
365int(56)
366bool(false)
367
368-- Testing fgetcsv() with file opened using rt mode --
369array(2) {
370  [0]=>
371  string(5) "water"
372  [1]=>
373  string(5) "fruit"
374}
375int(16)
376bool(false)
377array(1) {
378  [0]=>
379  string(39) "This is line of text without csv fields"
380}
381int(56)
382bool(false)
383
384-- Testing fgetcsv() with file opened using r+ mode --
385array(2) {
386  [0]=>
387  string(5) "water"
388  [1]=>
389  string(5) "fruit"
390}
391int(16)
392bool(false)
393array(1) {
394  [0]=>
395  string(39) "This is line of text without csv fields"
396}
397int(56)
398bool(false)
399
400-- Testing fgetcsv() with file opened using r+b mode --
401array(2) {
402  [0]=>
403  string(5) "water"
404  [1]=>
405  string(5) "fruit"
406}
407int(16)
408bool(false)
409array(1) {
410  [0]=>
411  string(39) "This is line of text without csv fields"
412}
413int(56)
414bool(false)
415
416-- Testing fgetcsv() with file opened using r+t mode --
417array(2) {
418  [0]=>
419  string(5) "water"
420  [1]=>
421  string(5) "fruit"
422}
423int(16)
424bool(false)
425array(1) {
426  [0]=>
427  string(39) "This is line of text without csv fields"
428}
429int(56)
430bool(false)
431
432-- Testing fgetcsv() with file opened using a+ mode --
433array(2) {
434  [0]=>
435  string(5) "water"
436  [1]=>
437  string(5) "fruit"
438}
439int(16)
440bool(false)
441array(1) {
442  [0]=>
443  string(39) "This is line of text without csv fields"
444}
445int(56)
446bool(false)
447
448-- Testing fgetcsv() with file opened using a+b mode --
449array(2) {
450  [0]=>
451  string(5) "water"
452  [1]=>
453  string(5) "fruit"
454}
455int(16)
456bool(false)
457array(1) {
458  [0]=>
459  string(39) "This is line of text without csv fields"
460}
461int(56)
462bool(false)
463
464-- Testing fgetcsv() with file opened using a+t mode --
465array(2) {
466  [0]=>
467  string(5) "water"
468  [1]=>
469  string(5) "fruit"
470}
471int(16)
472bool(false)
473array(1) {
474  [0]=>
475  string(39) "This is line of text without csv fields"
476}
477int(56)
478bool(false)
479
480-- Testing fgetcsv() with file opened using w+ mode --
481array(2) {
482  [0]=>
483  string(5) "water"
484  [1]=>
485  string(5) "fruit"
486}
487int(16)
488bool(false)
489array(1) {
490  [0]=>
491  string(39) "This is line of text without csv fields"
492}
493int(56)
494bool(false)
495
496-- Testing fgetcsv() with file opened using w+b mode --
497array(2) {
498  [0]=>
499  string(5) "water"
500  [1]=>
501  string(5) "fruit"
502}
503int(16)
504bool(false)
505array(1) {
506  [0]=>
507  string(39) "This is line of text without csv fields"
508}
509int(56)
510bool(false)
511
512-- Testing fgetcsv() with file opened using w+t mode --
513array(2) {
514  [0]=>
515  string(5) "water"
516  [1]=>
517  string(5) "fruit"
518}
519int(16)
520bool(false)
521array(1) {
522  [0]=>
523  string(39) "This is line of text without csv fields"
524}
525int(56)
526bool(false)
527
528-- Testing fgetcsv() with file opened using x+ mode --
529array(2) {
530  [0]=>
531  string(5) "water"
532  [1]=>
533  string(5) "fruit"
534}
535int(16)
536bool(false)
537array(1) {
538  [0]=>
539  string(39) "This is line of text without csv fields"
540}
541int(56)
542bool(false)
543
544-- Testing fgetcsv() with file opened using x+b mode --
545array(2) {
546  [0]=>
547  string(5) "water"
548  [1]=>
549  string(5) "fruit"
550}
551int(16)
552bool(false)
553array(1) {
554  [0]=>
555  string(39) "This is line of text without csv fields"
556}
557int(56)
558bool(false)
559
560-- Testing fgetcsv() with file opened using x+t mode --
561array(2) {
562  [0]=>
563  string(5) "water"
564  [1]=>
565  string(5) "fruit"
566}
567int(16)
568bool(false)
569array(1) {
570  [0]=>
571  string(39) "This is line of text without csv fields"
572}
573int(56)
574bool(false)
575
576-- Testing fgetcsv() with file opened using r mode --
577array(2) {
578  [0]=>
579  string(5) "water"
580  [1]=>
581  string(5) "fruit"
582}
583int(16)
584bool(false)
585array(8) {
586  [0]=>
587  string(4) "This"
588  [1]=>
589  string(2) "is"
590  [2]=>
591  string(4) "line"
592  [3]=>
593  string(2) "of"
594  [4]=>
595  string(4) "text"
596  [5]=>
597  string(7) "without"
598  [6]=>
599  string(3) "csv"
600  [7]=>
601  string(6) "fields"
602}
603int(56)
604bool(false)
605
606-- Testing fgetcsv() with file opened using rb mode --
607array(2) {
608  [0]=>
609  string(5) "water"
610  [1]=>
611  string(5) "fruit"
612}
613int(16)
614bool(false)
615array(8) {
616  [0]=>
617  string(4) "This"
618  [1]=>
619  string(2) "is"
620  [2]=>
621  string(4) "line"
622  [3]=>
623  string(2) "of"
624  [4]=>
625  string(4) "text"
626  [5]=>
627  string(7) "without"
628  [6]=>
629  string(3) "csv"
630  [7]=>
631  string(6) "fields"
632}
633int(56)
634bool(false)
635
636-- Testing fgetcsv() with file opened using rt mode --
637array(2) {
638  [0]=>
639  string(5) "water"
640  [1]=>
641  string(5) "fruit"
642}
643int(16)
644bool(false)
645array(8) {
646  [0]=>
647  string(4) "This"
648  [1]=>
649  string(2) "is"
650  [2]=>
651  string(4) "line"
652  [3]=>
653  string(2) "of"
654  [4]=>
655  string(4) "text"
656  [5]=>
657  string(7) "without"
658  [6]=>
659  string(3) "csv"
660  [7]=>
661  string(6) "fields"
662}
663int(56)
664bool(false)
665
666-- Testing fgetcsv() with file opened using r+ mode --
667array(2) {
668  [0]=>
669  string(5) "water"
670  [1]=>
671  string(5) "fruit"
672}
673int(16)
674bool(false)
675array(8) {
676  [0]=>
677  string(4) "This"
678  [1]=>
679  string(2) "is"
680  [2]=>
681  string(4) "line"
682  [3]=>
683  string(2) "of"
684  [4]=>
685  string(4) "text"
686  [5]=>
687  string(7) "without"
688  [6]=>
689  string(3) "csv"
690  [7]=>
691  string(6) "fields"
692}
693int(56)
694bool(false)
695
696-- Testing fgetcsv() with file opened using r+b mode --
697array(2) {
698  [0]=>
699  string(5) "water"
700  [1]=>
701  string(5) "fruit"
702}
703int(16)
704bool(false)
705array(8) {
706  [0]=>
707  string(4) "This"
708  [1]=>
709  string(2) "is"
710  [2]=>
711  string(4) "line"
712  [3]=>
713  string(2) "of"
714  [4]=>
715  string(4) "text"
716  [5]=>
717  string(7) "without"
718  [6]=>
719  string(3) "csv"
720  [7]=>
721  string(6) "fields"
722}
723int(56)
724bool(false)
725
726-- Testing fgetcsv() with file opened using r+t mode --
727array(2) {
728  [0]=>
729  string(5) "water"
730  [1]=>
731  string(5) "fruit"
732}
733int(16)
734bool(false)
735array(8) {
736  [0]=>
737  string(4) "This"
738  [1]=>
739  string(2) "is"
740  [2]=>
741  string(4) "line"
742  [3]=>
743  string(2) "of"
744  [4]=>
745  string(4) "text"
746  [5]=>
747  string(7) "without"
748  [6]=>
749  string(3) "csv"
750  [7]=>
751  string(6) "fields"
752}
753int(56)
754bool(false)
755
756-- Testing fgetcsv() with file opened using a+ mode --
757array(2) {
758  [0]=>
759  string(5) "water"
760  [1]=>
761  string(5) "fruit"
762}
763int(16)
764bool(false)
765array(8) {
766  [0]=>
767  string(4) "This"
768  [1]=>
769  string(2) "is"
770  [2]=>
771  string(4) "line"
772  [3]=>
773  string(2) "of"
774  [4]=>
775  string(4) "text"
776  [5]=>
777  string(7) "without"
778  [6]=>
779  string(3) "csv"
780  [7]=>
781  string(6) "fields"
782}
783int(56)
784bool(false)
785
786-- Testing fgetcsv() with file opened using a+b mode --
787array(2) {
788  [0]=>
789  string(5) "water"
790  [1]=>
791  string(5) "fruit"
792}
793int(16)
794bool(false)
795array(8) {
796  [0]=>
797  string(4) "This"
798  [1]=>
799  string(2) "is"
800  [2]=>
801  string(4) "line"
802  [3]=>
803  string(2) "of"
804  [4]=>
805  string(4) "text"
806  [5]=>
807  string(7) "without"
808  [6]=>
809  string(3) "csv"
810  [7]=>
811  string(6) "fields"
812}
813int(56)
814bool(false)
815
816-- Testing fgetcsv() with file opened using a+t mode --
817array(2) {
818  [0]=>
819  string(5) "water"
820  [1]=>
821  string(5) "fruit"
822}
823int(16)
824bool(false)
825array(8) {
826  [0]=>
827  string(4) "This"
828  [1]=>
829  string(2) "is"
830  [2]=>
831  string(4) "line"
832  [3]=>
833  string(2) "of"
834  [4]=>
835  string(4) "text"
836  [5]=>
837  string(7) "without"
838  [6]=>
839  string(3) "csv"
840  [7]=>
841  string(6) "fields"
842}
843int(56)
844bool(false)
845
846-- Testing fgetcsv() with file opened using w+ mode --
847array(2) {
848  [0]=>
849  string(5) "water"
850  [1]=>
851  string(5) "fruit"
852}
853int(16)
854bool(false)
855array(8) {
856  [0]=>
857  string(4) "This"
858  [1]=>
859  string(2) "is"
860  [2]=>
861  string(4) "line"
862  [3]=>
863  string(2) "of"
864  [4]=>
865  string(4) "text"
866  [5]=>
867  string(7) "without"
868  [6]=>
869  string(3) "csv"
870  [7]=>
871  string(6) "fields"
872}
873int(56)
874bool(false)
875
876-- Testing fgetcsv() with file opened using w+b mode --
877array(2) {
878  [0]=>
879  string(5) "water"
880  [1]=>
881  string(5) "fruit"
882}
883int(16)
884bool(false)
885array(8) {
886  [0]=>
887  string(4) "This"
888  [1]=>
889  string(2) "is"
890  [2]=>
891  string(4) "line"
892  [3]=>
893  string(2) "of"
894  [4]=>
895  string(4) "text"
896  [5]=>
897  string(7) "without"
898  [6]=>
899  string(3) "csv"
900  [7]=>
901  string(6) "fields"
902}
903int(56)
904bool(false)
905
906-- Testing fgetcsv() with file opened using w+t mode --
907array(2) {
908  [0]=>
909  string(5) "water"
910  [1]=>
911  string(5) "fruit"
912}
913int(16)
914bool(false)
915array(8) {
916  [0]=>
917  string(4) "This"
918  [1]=>
919  string(2) "is"
920  [2]=>
921  string(4) "line"
922  [3]=>
923  string(2) "of"
924  [4]=>
925  string(4) "text"
926  [5]=>
927  string(7) "without"
928  [6]=>
929  string(3) "csv"
930  [7]=>
931  string(6) "fields"
932}
933int(56)
934bool(false)
935
936-- Testing fgetcsv() with file opened using x+ mode --
937array(2) {
938  [0]=>
939  string(5) "water"
940  [1]=>
941  string(5) "fruit"
942}
943int(16)
944bool(false)
945array(8) {
946  [0]=>
947  string(4) "This"
948  [1]=>
949  string(2) "is"
950  [2]=>
951  string(4) "line"
952  [3]=>
953  string(2) "of"
954  [4]=>
955  string(4) "text"
956  [5]=>
957  string(7) "without"
958  [6]=>
959  string(3) "csv"
960  [7]=>
961  string(6) "fields"
962}
963int(56)
964bool(false)
965
966-- Testing fgetcsv() with file opened using x+b mode --
967array(2) {
968  [0]=>
969  string(5) "water"
970  [1]=>
971  string(5) "fruit"
972}
973int(16)
974bool(false)
975array(8) {
976  [0]=>
977  string(4) "This"
978  [1]=>
979  string(2) "is"
980  [2]=>
981  string(4) "line"
982  [3]=>
983  string(2) "of"
984  [4]=>
985  string(4) "text"
986  [5]=>
987  string(7) "without"
988  [6]=>
989  string(3) "csv"
990  [7]=>
991  string(6) "fields"
992}
993int(56)
994bool(false)
995
996-- Testing fgetcsv() with file opened using x+t mode --
997array(2) {
998  [0]=>
999  string(5) "water"
1000  [1]=>
1001  string(5) "fruit"
1002}
1003int(16)
1004bool(false)
1005array(8) {
1006  [0]=>
1007  string(4) "This"
1008  [1]=>
1009  string(2) "is"
1010  [2]=>
1011  string(4) "line"
1012  [3]=>
1013  string(2) "of"
1014  [4]=>
1015  string(4) "text"
1016  [5]=>
1017  string(7) "without"
1018  [6]=>
1019  string(3) "csv"
1020  [7]=>
1021  string(6) "fields"
1022}
1023int(56)
1024bool(false)
1025
1026-- Testing fgetcsv() with file opened using r mode --
1027array(2) {
1028  [0]=>
1029  string(5) "water"
1030  [1]=>
1031  string(5) "fruit"
1032}
1033int(16)
1034bool(false)
1035array(1) {
1036  [0]=>
1037  string(39) "This is line of text without csv fields"
1038}
1039int(56)
1040bool(false)
1041
1042-- Testing fgetcsv() with file opened using rb mode --
1043array(2) {
1044  [0]=>
1045  string(5) "water"
1046  [1]=>
1047  string(5) "fruit"
1048}
1049int(16)
1050bool(false)
1051array(1) {
1052  [0]=>
1053  string(39) "This is line of text without csv fields"
1054}
1055int(56)
1056bool(false)
1057
1058-- Testing fgetcsv() with file opened using rt mode --
1059array(2) {
1060  [0]=>
1061  string(5) "water"
1062  [1]=>
1063  string(5) "fruit"
1064}
1065int(16)
1066bool(false)
1067array(1) {
1068  [0]=>
1069  string(39) "This is line of text without csv fields"
1070}
1071int(56)
1072bool(false)
1073
1074-- Testing fgetcsv() with file opened using r+ mode --
1075array(2) {
1076  [0]=>
1077  string(5) "water"
1078  [1]=>
1079  string(5) "fruit"
1080}
1081int(16)
1082bool(false)
1083array(1) {
1084  [0]=>
1085  string(39) "This is line of text without csv fields"
1086}
1087int(56)
1088bool(false)
1089
1090-- Testing fgetcsv() with file opened using r+b mode --
1091array(2) {
1092  [0]=>
1093  string(5) "water"
1094  [1]=>
1095  string(5) "fruit"
1096}
1097int(16)
1098bool(false)
1099array(1) {
1100  [0]=>
1101  string(39) "This is line of text without csv fields"
1102}
1103int(56)
1104bool(false)
1105
1106-- Testing fgetcsv() with file opened using r+t mode --
1107array(2) {
1108  [0]=>
1109  string(5) "water"
1110  [1]=>
1111  string(5) "fruit"
1112}
1113int(16)
1114bool(false)
1115array(1) {
1116  [0]=>
1117  string(39) "This is line of text without csv fields"
1118}
1119int(56)
1120bool(false)
1121
1122-- Testing fgetcsv() with file opened using a+ mode --
1123array(2) {
1124  [0]=>
1125  string(5) "water"
1126  [1]=>
1127  string(5) "fruit"
1128}
1129int(16)
1130bool(false)
1131array(1) {
1132  [0]=>
1133  string(39) "This is line of text without csv fields"
1134}
1135int(56)
1136bool(false)
1137
1138-- Testing fgetcsv() with file opened using a+b mode --
1139array(2) {
1140  [0]=>
1141  string(5) "water"
1142  [1]=>
1143  string(5) "fruit"
1144}
1145int(16)
1146bool(false)
1147array(1) {
1148  [0]=>
1149  string(39) "This is line of text without csv fields"
1150}
1151int(56)
1152bool(false)
1153
1154-- Testing fgetcsv() with file opened using a+t mode --
1155array(2) {
1156  [0]=>
1157  string(5) "water"
1158  [1]=>
1159  string(5) "fruit"
1160}
1161int(16)
1162bool(false)
1163array(1) {
1164  [0]=>
1165  string(39) "This is line of text without csv fields"
1166}
1167int(56)
1168bool(false)
1169
1170-- Testing fgetcsv() with file opened using w+ mode --
1171array(2) {
1172  [0]=>
1173  string(5) "water"
1174  [1]=>
1175  string(5) "fruit"
1176}
1177int(16)
1178bool(false)
1179array(1) {
1180  [0]=>
1181  string(39) "This is line of text without csv fields"
1182}
1183int(56)
1184bool(false)
1185
1186-- Testing fgetcsv() with file opened using w+b mode --
1187array(2) {
1188  [0]=>
1189  string(5) "water"
1190  [1]=>
1191  string(5) "fruit"
1192}
1193int(16)
1194bool(false)
1195array(1) {
1196  [0]=>
1197  string(39) "This is line of text without csv fields"
1198}
1199int(56)
1200bool(false)
1201
1202-- Testing fgetcsv() with file opened using w+t mode --
1203array(2) {
1204  [0]=>
1205  string(5) "water"
1206  [1]=>
1207  string(5) "fruit"
1208}
1209int(16)
1210bool(false)
1211array(1) {
1212  [0]=>
1213  string(39) "This is line of text without csv fields"
1214}
1215int(56)
1216bool(false)
1217
1218-- Testing fgetcsv() with file opened using x+ mode --
1219array(2) {
1220  [0]=>
1221  string(5) "water"
1222  [1]=>
1223  string(5) "fruit"
1224}
1225int(16)
1226bool(false)
1227array(1) {
1228  [0]=>
1229  string(39) "This is line of text without csv fields"
1230}
1231int(56)
1232bool(false)
1233
1234-- Testing fgetcsv() with file opened using x+b mode --
1235array(2) {
1236  [0]=>
1237  string(5) "water"
1238  [1]=>
1239  string(5) "fruit"
1240}
1241int(16)
1242bool(false)
1243array(1) {
1244  [0]=>
1245  string(39) "This is line of text without csv fields"
1246}
1247int(56)
1248bool(false)
1249
1250-- Testing fgetcsv() with file opened using x+t mode --
1251array(2) {
1252  [0]=>
1253  string(5) "water"
1254  [1]=>
1255  string(5) "fruit"
1256}
1257int(16)
1258bool(false)
1259array(1) {
1260  [0]=>
1261  string(39) "This is line of text without csv fields"
1262}
1263int(56)
1264bool(false)
1265
1266-- Testing fgetcsv() with file opened using r mode --
1267array(1) {
1268  [0]=>
1269  string(6) "water="
1270}
1271int(9)
1272bool(false)
1273array(2) {
1274  [0]=>
1275  string(5) "fruit"
1276  [1]=>
1277  string(0) ""
1278}
1279int(16)
1280bool(false)
1281
1282-- Testing fgetcsv() with file opened using rb mode --
1283array(1) {
1284  [0]=>
1285  string(6) "water="
1286}
1287int(9)
1288bool(false)
1289array(2) {
1290  [0]=>
1291  string(5) "fruit"
1292  [1]=>
1293  string(0) ""
1294}
1295int(16)
1296bool(false)
1297
1298-- Testing fgetcsv() with file opened using rt mode --
1299array(1) {
1300  [0]=>
1301  string(6) "water="
1302}
1303int(9)
1304bool(false)
1305array(2) {
1306  [0]=>
1307  string(5) "fruit"
1308  [1]=>
1309  string(0) ""
1310}
1311int(16)
1312bool(false)
1313
1314-- Testing fgetcsv() with file opened using r+ mode --
1315array(1) {
1316  [0]=>
1317  string(6) "water="
1318}
1319int(9)
1320bool(false)
1321array(2) {
1322  [0]=>
1323  string(5) "fruit"
1324  [1]=>
1325  string(0) ""
1326}
1327int(16)
1328bool(false)
1329
1330-- Testing fgetcsv() with file opened using r+b mode --
1331array(1) {
1332  [0]=>
1333  string(6) "water="
1334}
1335int(9)
1336bool(false)
1337array(2) {
1338  [0]=>
1339  string(5) "fruit"
1340  [1]=>
1341  string(0) ""
1342}
1343int(16)
1344bool(false)
1345
1346-- Testing fgetcsv() with file opened using r+t mode --
1347array(1) {
1348  [0]=>
1349  string(6) "water="
1350}
1351int(9)
1352bool(false)
1353array(2) {
1354  [0]=>
1355  string(5) "fruit"
1356  [1]=>
1357  string(0) ""
1358}
1359int(16)
1360bool(false)
1361
1362-- Testing fgetcsv() with file opened using a+ mode --
1363array(1) {
1364  [0]=>
1365  string(6) "water="
1366}
1367int(9)
1368bool(false)
1369array(2) {
1370  [0]=>
1371  string(5) "fruit"
1372  [1]=>
1373  string(0) ""
1374}
1375int(16)
1376bool(false)
1377
1378-- Testing fgetcsv() with file opened using a+b mode --
1379array(1) {
1380  [0]=>
1381  string(6) "water="
1382}
1383int(9)
1384bool(false)
1385array(2) {
1386  [0]=>
1387  string(5) "fruit"
1388  [1]=>
1389  string(0) ""
1390}
1391int(16)
1392bool(false)
1393
1394-- Testing fgetcsv() with file opened using a+t mode --
1395array(1) {
1396  [0]=>
1397  string(6) "water="
1398}
1399int(9)
1400bool(false)
1401array(2) {
1402  [0]=>
1403  string(5) "fruit"
1404  [1]=>
1405  string(0) ""
1406}
1407int(16)
1408bool(false)
1409
1410-- Testing fgetcsv() with file opened using w+ mode --
1411array(1) {
1412  [0]=>
1413  string(6) "water="
1414}
1415int(9)
1416bool(false)
1417array(2) {
1418  [0]=>
1419  string(5) "fruit"
1420  [1]=>
1421  string(0) ""
1422}
1423int(16)
1424bool(false)
1425
1426-- Testing fgetcsv() with file opened using w+b mode --
1427array(1) {
1428  [0]=>
1429  string(6) "water="
1430}
1431int(9)
1432bool(false)
1433array(2) {
1434  [0]=>
1435  string(5) "fruit"
1436  [1]=>
1437  string(0) ""
1438}
1439int(16)
1440bool(false)
1441
1442-- Testing fgetcsv() with file opened using w+t mode --
1443array(1) {
1444  [0]=>
1445  string(6) "water="
1446}
1447int(9)
1448bool(false)
1449array(2) {
1450  [0]=>
1451  string(5) "fruit"
1452  [1]=>
1453  string(0) ""
1454}
1455int(16)
1456bool(false)
1457
1458-- Testing fgetcsv() with file opened using x+ mode --
1459array(1) {
1460  [0]=>
1461  string(6) "water="
1462}
1463int(9)
1464bool(false)
1465array(2) {
1466  [0]=>
1467  string(5) "fruit"
1468  [1]=>
1469  string(0) ""
1470}
1471int(16)
1472bool(false)
1473
1474-- Testing fgetcsv() with file opened using x+b mode --
1475array(1) {
1476  [0]=>
1477  string(6) "water="
1478}
1479int(9)
1480bool(false)
1481array(2) {
1482  [0]=>
1483  string(5) "fruit"
1484  [1]=>
1485  string(0) ""
1486}
1487int(16)
1488bool(false)
1489
1490-- Testing fgetcsv() with file opened using x+t mode --
1491array(1) {
1492  [0]=>
1493  string(6) "water="
1494}
1495int(9)
1496bool(false)
1497array(2) {
1498  [0]=>
1499  string(5) "fruit"
1500  [1]=>
1501  string(0) ""
1502}
1503int(16)
1504bool(false)
1505
1506-- Testing fgetcsv() with file opened using r mode --
1507array(1) {
1508  [0]=>
1509  string(14) "water-fruitair"
1510}
1511int(18)
1512bool(false)
1513array(1) {
1514  [0]=>
1515  string(39) "This is line of text without csv fields"
1516}
1517int(58)
1518bool(false)
1519
1520-- Testing fgetcsv() with file opened using rb mode --
1521array(1) {
1522  [0]=>
1523  string(14) "water-fruitair"
1524}
1525int(18)
1526bool(false)
1527array(1) {
1528  [0]=>
1529  string(39) "This is line of text without csv fields"
1530}
1531int(58)
1532bool(false)
1533
1534-- Testing fgetcsv() with file opened using rt mode --
1535array(1) {
1536  [0]=>
1537  string(14) "water-fruitair"
1538}
1539int(18)
1540bool(false)
1541array(1) {
1542  [0]=>
1543  string(39) "This is line of text without csv fields"
1544}
1545int(58)
1546bool(false)
1547
1548-- Testing fgetcsv() with file opened using r+ mode --
1549array(1) {
1550  [0]=>
1551  string(14) "water-fruitair"
1552}
1553int(18)
1554bool(false)
1555array(1) {
1556  [0]=>
1557  string(39) "This is line of text without csv fields"
1558}
1559int(58)
1560bool(false)
1561
1562-- Testing fgetcsv() with file opened using r+b mode --
1563array(1) {
1564  [0]=>
1565  string(14) "water-fruitair"
1566}
1567int(18)
1568bool(false)
1569array(1) {
1570  [0]=>
1571  string(39) "This is line of text without csv fields"
1572}
1573int(58)
1574bool(false)
1575
1576-- Testing fgetcsv() with file opened using r+t mode --
1577array(1) {
1578  [0]=>
1579  string(14) "water-fruitair"
1580}
1581int(18)
1582bool(false)
1583array(1) {
1584  [0]=>
1585  string(39) "This is line of text without csv fields"
1586}
1587int(58)
1588bool(false)
1589
1590-- Testing fgetcsv() with file opened using a+ mode --
1591array(1) {
1592  [0]=>
1593  string(14) "water-fruitair"
1594}
1595int(18)
1596bool(false)
1597array(1) {
1598  [0]=>
1599  string(39) "This is line of text without csv fields"
1600}
1601int(58)
1602bool(false)
1603
1604-- Testing fgetcsv() with file opened using a+b mode --
1605array(1) {
1606  [0]=>
1607  string(14) "water-fruitair"
1608}
1609int(18)
1610bool(false)
1611array(1) {
1612  [0]=>
1613  string(39) "This is line of text without csv fields"
1614}
1615int(58)
1616bool(false)
1617
1618-- Testing fgetcsv() with file opened using a+t mode --
1619array(1) {
1620  [0]=>
1621  string(14) "water-fruitair"
1622}
1623int(18)
1624bool(false)
1625array(1) {
1626  [0]=>
1627  string(39) "This is line of text without csv fields"
1628}
1629int(58)
1630bool(false)
1631
1632-- Testing fgetcsv() with file opened using w+ mode --
1633array(1) {
1634  [0]=>
1635  string(14) "water-fruitair"
1636}
1637int(18)
1638bool(false)
1639array(1) {
1640  [0]=>
1641  string(39) "This is line of text without csv fields"
1642}
1643int(58)
1644bool(false)
1645
1646-- Testing fgetcsv() with file opened using w+b mode --
1647array(1) {
1648  [0]=>
1649  string(14) "water-fruitair"
1650}
1651int(18)
1652bool(false)
1653array(1) {
1654  [0]=>
1655  string(39) "This is line of text without csv fields"
1656}
1657int(58)
1658bool(false)
1659
1660-- Testing fgetcsv() with file opened using w+t mode --
1661array(1) {
1662  [0]=>
1663  string(14) "water-fruitair"
1664}
1665int(18)
1666bool(false)
1667array(1) {
1668  [0]=>
1669  string(39) "This is line of text without csv fields"
1670}
1671int(58)
1672bool(false)
1673
1674-- Testing fgetcsv() with file opened using x+ mode --
1675array(1) {
1676  [0]=>
1677  string(14) "water-fruitair"
1678}
1679int(18)
1680bool(false)
1681array(1) {
1682  [0]=>
1683  string(39) "This is line of text without csv fields"
1684}
1685int(58)
1686bool(false)
1687
1688-- Testing fgetcsv() with file opened using x+b mode --
1689array(1) {
1690  [0]=>
1691  string(14) "water-fruitair"
1692}
1693int(18)
1694bool(false)
1695array(1) {
1696  [0]=>
1697  string(39) "This is line of text without csv fields"
1698}
1699int(58)
1700bool(false)
1701
1702-- Testing fgetcsv() with file opened using x+t mode --
1703array(1) {
1704  [0]=>
1705  string(14) "water-fruitair"
1706}
1707int(18)
1708bool(false)
1709array(1) {
1710  [0]=>
1711  string(39) "This is line of text without csv fields"
1712}
1713int(58)
1714bool(false)
1715
1716-- Testing fgetcsv() with file opened using r mode --
1717array(1) {
1718  [0]=>
1719  string(6) "water-"
1720}
1721int(9)
1722bool(false)
1723array(3) {
1724  [0]=>
1725  string(5) "fruit"
1726  [1]=>
1727  string(3) "air"
1728  [2]=>
1729  string(0) ""
1730}
1731int(22)
1732bool(false)
1733
1734-- Testing fgetcsv() with file opened using rb mode --
1735array(1) {
1736  [0]=>
1737  string(6) "water-"
1738}
1739int(9)
1740bool(false)
1741array(3) {
1742  [0]=>
1743  string(5) "fruit"
1744  [1]=>
1745  string(3) "air"
1746  [2]=>
1747  string(0) ""
1748}
1749int(22)
1750bool(false)
1751
1752-- Testing fgetcsv() with file opened using rt mode --
1753array(1) {
1754  [0]=>
1755  string(6) "water-"
1756}
1757int(9)
1758bool(false)
1759array(3) {
1760  [0]=>
1761  string(5) "fruit"
1762  [1]=>
1763  string(3) "air"
1764  [2]=>
1765  string(0) ""
1766}
1767int(22)
1768bool(false)
1769
1770-- Testing fgetcsv() with file opened using r+ mode --
1771array(1) {
1772  [0]=>
1773  string(6) "water-"
1774}
1775int(9)
1776bool(false)
1777array(3) {
1778  [0]=>
1779  string(5) "fruit"
1780  [1]=>
1781  string(3) "air"
1782  [2]=>
1783  string(0) ""
1784}
1785int(22)
1786bool(false)
1787
1788-- Testing fgetcsv() with file opened using r+b mode --
1789array(1) {
1790  [0]=>
1791  string(6) "water-"
1792}
1793int(9)
1794bool(false)
1795array(3) {
1796  [0]=>
1797  string(5) "fruit"
1798  [1]=>
1799  string(3) "air"
1800  [2]=>
1801  string(0) ""
1802}
1803int(22)
1804bool(false)
1805
1806-- Testing fgetcsv() with file opened using r+t mode --
1807array(1) {
1808  [0]=>
1809  string(6) "water-"
1810}
1811int(9)
1812bool(false)
1813array(3) {
1814  [0]=>
1815  string(5) "fruit"
1816  [1]=>
1817  string(3) "air"
1818  [2]=>
1819  string(0) ""
1820}
1821int(22)
1822bool(false)
1823
1824-- Testing fgetcsv() with file opened using a+ mode --
1825array(1) {
1826  [0]=>
1827  string(6) "water-"
1828}
1829int(9)
1830bool(false)
1831array(3) {
1832  [0]=>
1833  string(5) "fruit"
1834  [1]=>
1835  string(3) "air"
1836  [2]=>
1837  string(0) ""
1838}
1839int(22)
1840bool(false)
1841
1842-- Testing fgetcsv() with file opened using a+b mode --
1843array(1) {
1844  [0]=>
1845  string(6) "water-"
1846}
1847int(9)
1848bool(false)
1849array(3) {
1850  [0]=>
1851  string(5) "fruit"
1852  [1]=>
1853  string(3) "air"
1854  [2]=>
1855  string(0) ""
1856}
1857int(22)
1858bool(false)
1859
1860-- Testing fgetcsv() with file opened using a+t mode --
1861array(1) {
1862  [0]=>
1863  string(6) "water-"
1864}
1865int(9)
1866bool(false)
1867array(3) {
1868  [0]=>
1869  string(5) "fruit"
1870  [1]=>
1871  string(3) "air"
1872  [2]=>
1873  string(0) ""
1874}
1875int(22)
1876bool(false)
1877
1878-- Testing fgetcsv() with file opened using w+ mode --
1879array(1) {
1880  [0]=>
1881  string(6) "water-"
1882}
1883int(9)
1884bool(false)
1885array(3) {
1886  [0]=>
1887  string(5) "fruit"
1888  [1]=>
1889  string(3) "air"
1890  [2]=>
1891  string(0) ""
1892}
1893int(22)
1894bool(false)
1895
1896-- Testing fgetcsv() with file opened using w+b mode --
1897array(1) {
1898  [0]=>
1899  string(6) "water-"
1900}
1901int(9)
1902bool(false)
1903array(3) {
1904  [0]=>
1905  string(5) "fruit"
1906  [1]=>
1907  string(3) "air"
1908  [2]=>
1909  string(0) ""
1910}
1911int(22)
1912bool(false)
1913
1914-- Testing fgetcsv() with file opened using w+t mode --
1915array(1) {
1916  [0]=>
1917  string(6) "water-"
1918}
1919int(9)
1920bool(false)
1921array(3) {
1922  [0]=>
1923  string(5) "fruit"
1924  [1]=>
1925  string(3) "air"
1926  [2]=>
1927  string(0) ""
1928}
1929int(22)
1930bool(false)
1931
1932-- Testing fgetcsv() with file opened using x+ mode --
1933array(1) {
1934  [0]=>
1935  string(6) "water-"
1936}
1937int(9)
1938bool(false)
1939array(3) {
1940  [0]=>
1941  string(5) "fruit"
1942  [1]=>
1943  string(3) "air"
1944  [2]=>
1945  string(0) ""
1946}
1947int(22)
1948bool(false)
1949
1950-- Testing fgetcsv() with file opened using x+b mode --
1951array(1) {
1952  [0]=>
1953  string(6) "water-"
1954}
1955int(9)
1956bool(false)
1957array(3) {
1958  [0]=>
1959  string(5) "fruit"
1960  [1]=>
1961  string(3) "air"
1962  [2]=>
1963  string(0) ""
1964}
1965int(22)
1966bool(false)
1967
1968-- Testing fgetcsv() with file opened using x+t mode --
1969array(1) {
1970  [0]=>
1971  string(6) "water-"
1972}
1973int(9)
1974bool(false)
1975array(3) {
1976  [0]=>
1977  string(5) "fruit"
1978  [1]=>
1979  string(3) "air"
1980  [2]=>
1981  string(0) ""
1982}
1983int(22)
1984bool(false)
1985
1986-- Testing fgetcsv() with file opened using r mode --
1987array(6) {
1988  [0]=>
1989  string(4) """"""
1990  [1]=>
1991  string(1) """
1992  [2]=>
1993  string(1) ","
1994  [3]=>
1995  string(1) """
1996  [4]=>
1997  string(1) ","
1998  [5]=>
1999  string(4) ",,,,"
2000}
2001int(24)
2002bool(false)
2003array(1) {
2004  [0]=>
2005  string(39) "This is line of text without csv fields"
2006}
2007int(64)
2008bool(false)
2009
2010-- Testing fgetcsv() with file opened using rb mode --
2011array(6) {
2012  [0]=>
2013  string(4) """"""
2014  [1]=>
2015  string(1) """
2016  [2]=>
2017  string(1) ","
2018  [3]=>
2019  string(1) """
2020  [4]=>
2021  string(1) ","
2022  [5]=>
2023  string(4) ",,,,"
2024}
2025int(24)
2026bool(false)
2027array(1) {
2028  [0]=>
2029  string(39) "This is line of text without csv fields"
2030}
2031int(64)
2032bool(false)
2033
2034-- Testing fgetcsv() with file opened using rt mode --
2035array(6) {
2036  [0]=>
2037  string(4) """"""
2038  [1]=>
2039  string(1) """
2040  [2]=>
2041  string(1) ","
2042  [3]=>
2043  string(1) """
2044  [4]=>
2045  string(1) ","
2046  [5]=>
2047  string(4) ",,,,"
2048}
2049int(24)
2050bool(false)
2051array(1) {
2052  [0]=>
2053  string(39) "This is line of text without csv fields"
2054}
2055int(64)
2056bool(false)
2057
2058-- Testing fgetcsv() with file opened using r+ mode --
2059array(6) {
2060  [0]=>
2061  string(4) """"""
2062  [1]=>
2063  string(1) """
2064  [2]=>
2065  string(1) ","
2066  [3]=>
2067  string(1) """
2068  [4]=>
2069  string(1) ","
2070  [5]=>
2071  string(4) ",,,,"
2072}
2073int(24)
2074bool(false)
2075array(1) {
2076  [0]=>
2077  string(39) "This is line of text without csv fields"
2078}
2079int(64)
2080bool(false)
2081
2082-- Testing fgetcsv() with file opened using r+b mode --
2083array(6) {
2084  [0]=>
2085  string(4) """"""
2086  [1]=>
2087  string(1) """
2088  [2]=>
2089  string(1) ","
2090  [3]=>
2091  string(1) """
2092  [4]=>
2093  string(1) ","
2094  [5]=>
2095  string(4) ",,,,"
2096}
2097int(24)
2098bool(false)
2099array(1) {
2100  [0]=>
2101  string(39) "This is line of text without csv fields"
2102}
2103int(64)
2104bool(false)
2105
2106-- Testing fgetcsv() with file opened using r+t mode --
2107array(6) {
2108  [0]=>
2109  string(4) """"""
2110  [1]=>
2111  string(1) """
2112  [2]=>
2113  string(1) ","
2114  [3]=>
2115  string(1) """
2116  [4]=>
2117  string(1) ","
2118  [5]=>
2119  string(4) ",,,,"
2120}
2121int(24)
2122bool(false)
2123array(1) {
2124  [0]=>
2125  string(39) "This is line of text without csv fields"
2126}
2127int(64)
2128bool(false)
2129
2130-- Testing fgetcsv() with file opened using a+ mode --
2131array(6) {
2132  [0]=>
2133  string(4) """"""
2134  [1]=>
2135  string(1) """
2136  [2]=>
2137  string(1) ","
2138  [3]=>
2139  string(1) """
2140  [4]=>
2141  string(1) ","
2142  [5]=>
2143  string(4) ",,,,"
2144}
2145int(24)
2146bool(false)
2147array(1) {
2148  [0]=>
2149  string(39) "This is line of text without csv fields"
2150}
2151int(64)
2152bool(false)
2153
2154-- Testing fgetcsv() with file opened using a+b mode --
2155array(6) {
2156  [0]=>
2157  string(4) """"""
2158  [1]=>
2159  string(1) """
2160  [2]=>
2161  string(1) ","
2162  [3]=>
2163  string(1) """
2164  [4]=>
2165  string(1) ","
2166  [5]=>
2167  string(4) ",,,,"
2168}
2169int(24)
2170bool(false)
2171array(1) {
2172  [0]=>
2173  string(39) "This is line of text without csv fields"
2174}
2175int(64)
2176bool(false)
2177
2178-- Testing fgetcsv() with file opened using a+t mode --
2179array(6) {
2180  [0]=>
2181  string(4) """"""
2182  [1]=>
2183  string(1) """
2184  [2]=>
2185  string(1) ","
2186  [3]=>
2187  string(1) """
2188  [4]=>
2189  string(1) ","
2190  [5]=>
2191  string(4) ",,,,"
2192}
2193int(24)
2194bool(false)
2195array(1) {
2196  [0]=>
2197  string(39) "This is line of text without csv fields"
2198}
2199int(64)
2200bool(false)
2201
2202-- Testing fgetcsv() with file opened using w+ mode --
2203array(6) {
2204  [0]=>
2205  string(4) """"""
2206  [1]=>
2207  string(1) """
2208  [2]=>
2209  string(1) ","
2210  [3]=>
2211  string(1) """
2212  [4]=>
2213  string(1) ","
2214  [5]=>
2215  string(4) ",,,,"
2216}
2217int(24)
2218bool(false)
2219array(1) {
2220  [0]=>
2221  string(39) "This is line of text without csv fields"
2222}
2223int(64)
2224bool(false)
2225
2226-- Testing fgetcsv() with file opened using w+b mode --
2227array(6) {
2228  [0]=>
2229  string(4) """"""
2230  [1]=>
2231  string(1) """
2232  [2]=>
2233  string(1) ","
2234  [3]=>
2235  string(1) """
2236  [4]=>
2237  string(1) ","
2238  [5]=>
2239  string(4) ",,,,"
2240}
2241int(24)
2242bool(false)
2243array(1) {
2244  [0]=>
2245  string(39) "This is line of text without csv fields"
2246}
2247int(64)
2248bool(false)
2249
2250-- Testing fgetcsv() with file opened using w+t mode --
2251array(6) {
2252  [0]=>
2253  string(4) """"""
2254  [1]=>
2255  string(1) """
2256  [2]=>
2257  string(1) ","
2258  [3]=>
2259  string(1) """
2260  [4]=>
2261  string(1) ","
2262  [5]=>
2263  string(4) ",,,,"
2264}
2265int(24)
2266bool(false)
2267array(1) {
2268  [0]=>
2269  string(39) "This is line of text without csv fields"
2270}
2271int(64)
2272bool(false)
2273
2274-- Testing fgetcsv() with file opened using x+ mode --
2275array(6) {
2276  [0]=>
2277  string(4) """"""
2278  [1]=>
2279  string(1) """
2280  [2]=>
2281  string(1) ","
2282  [3]=>
2283  string(1) """
2284  [4]=>
2285  string(1) ","
2286  [5]=>
2287  string(4) ",,,,"
2288}
2289int(24)
2290bool(false)
2291array(1) {
2292  [0]=>
2293  string(39) "This is line of text without csv fields"
2294}
2295int(64)
2296bool(false)
2297
2298-- Testing fgetcsv() with file opened using x+b mode --
2299array(6) {
2300  [0]=>
2301  string(4) """"""
2302  [1]=>
2303  string(1) """
2304  [2]=>
2305  string(1) ","
2306  [3]=>
2307  string(1) """
2308  [4]=>
2309  string(1) ","
2310  [5]=>
2311  string(4) ",,,,"
2312}
2313int(24)
2314bool(false)
2315array(1) {
2316  [0]=>
2317  string(39) "This is line of text without csv fields"
2318}
2319int(64)
2320bool(false)
2321
2322-- Testing fgetcsv() with file opened using x+t mode --
2323array(6) {
2324  [0]=>
2325  string(4) """"""
2326  [1]=>
2327  string(1) """
2328  [2]=>
2329  string(1) ","
2330  [3]=>
2331  string(1) """
2332  [4]=>
2333  string(1) ","
2334  [5]=>
2335  string(4) ",,,,"
2336}
2337int(24)
2338bool(false)
2339array(1) {
2340  [0]=>
2341  string(39) "This is line of text without csv fields"
2342}
2343int(64)
2344bool(false)
2345Done
2346