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