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