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