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