Return to fgetcsv_variation2.phpt CVS log | Up to [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / ext / standard / tests / file |
1.1 misho 1: --TEST--
2: Test 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:
12: echo "*** 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 = dirname(__FILE__) . '/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;
38: foreach ($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
1.1.1.2 ! misho 62: // else rewind the file pointer to beginning of the file
1.1 misho 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:
89: echo "Done\n";
90: ?>
91: --EXPECT--
92: *** Testing fgetcsv() : with length as 0 ***
93:
94: -- Testing fgetcsv() with file opened using r mode --
95: array(2) {
96: [0]=>
97: string(5) "water"
98: [1]=>
99: string(5) "fruit"
100: }
101: int(14)
102: bool(false)
103:
104: -- Testing fgetcsv() with file opened using rb mode --
105: array(2) {
106: [0]=>
107: string(5) "water"
108: [1]=>
109: string(5) "fruit"
110: }
111: int(14)
112: bool(false)
113:
114: -- Testing fgetcsv() with file opened using rt mode --
115: array(2) {
116: [0]=>
117: string(5) "water"
118: [1]=>
119: string(5) "fruit"
120: }
121: int(14)
122: bool(false)
123:
124: -- Testing fgetcsv() with file opened using r+ mode --
125: array(2) {
126: [0]=>
127: string(5) "water"
128: [1]=>
129: string(5) "fruit"
130: }
131: int(14)
132: bool(false)
133:
134: -- Testing fgetcsv() with file opened using r+b mode --
135: array(2) {
136: [0]=>
137: string(5) "water"
138: [1]=>
139: string(5) "fruit"
140: }
141: int(14)
142: bool(false)
143:
144: -- Testing fgetcsv() with file opened using r+t mode --
145: array(2) {
146: [0]=>
147: string(5) "water"
148: [1]=>
149: string(5) "fruit"
150: }
151: int(14)
152: bool(false)
153:
154: -- Testing fgetcsv() with file opened using a+ mode --
155: array(2) {
156: [0]=>
157: string(5) "water"
158: [1]=>
159: string(5) "fruit"
160: }
161: int(14)
162: bool(false)
163:
164: -- Testing fgetcsv() with file opened using a+b mode --
165: array(2) {
166: [0]=>
167: string(5) "water"
168: [1]=>
169: string(5) "fruit"
170: }
171: int(14)
172: bool(false)
173:
174: -- Testing fgetcsv() with file opened using a+t mode --
175: array(2) {
176: [0]=>
177: string(5) "water"
178: [1]=>
179: string(5) "fruit"
180: }
181: int(14)
182: bool(false)
183:
184: -- Testing fgetcsv() with file opened using w+ mode --
185: array(2) {
186: [0]=>
187: string(5) "water"
188: [1]=>
189: string(5) "fruit"
190: }
191: int(14)
192: bool(false)
193:
194: -- Testing fgetcsv() with file opened using w+b mode --
195: array(2) {
196: [0]=>
197: string(5) "water"
198: [1]=>
199: string(5) "fruit"
200: }
201: int(14)
202: bool(false)
203:
204: -- Testing fgetcsv() with file opened using w+t mode --
205: array(2) {
206: [0]=>
207: string(5) "water"
208: [1]=>
209: string(5) "fruit"
210: }
211: int(14)
212: bool(false)
213:
214: -- Testing fgetcsv() with file opened using x+ mode --
215: array(2) {
216: [0]=>
217: string(5) "water"
218: [1]=>
219: string(5) "fruit"
220: }
221: int(14)
222: bool(false)
223:
224: -- Testing fgetcsv() with file opened using x+b mode --
225: array(2) {
226: [0]=>
227: string(5) "water"
228: [1]=>
229: string(5) "fruit"
230: }
231: int(14)
232: bool(false)
233:
234: -- Testing fgetcsv() with file opened using x+t mode --
235: array(2) {
236: [0]=>
237: string(5) "water"
238: [1]=>
239: string(5) "fruit"
240: }
241: int(14)
242: bool(false)
243:
244: -- Testing fgetcsv() with file opened using r mode --
245: array(2) {
246: [0]=>
247: string(5) "water"
248: [1]=>
249: string(5) "fruit"
250: }
251: int(16)
252: bool(false)
253:
254: -- Testing fgetcsv() with file opened using rb mode --
255: array(2) {
256: [0]=>
257: string(5) "water"
258: [1]=>
259: string(5) "fruit"
260: }
261: int(16)
262: bool(false)
263:
264: -- Testing fgetcsv() with file opened using rt mode --
265: array(2) {
266: [0]=>
267: string(5) "water"
268: [1]=>
269: string(5) "fruit"
270: }
271: int(16)
272: bool(false)
273:
274: -- Testing fgetcsv() with file opened using r+ mode --
275: array(2) {
276: [0]=>
277: string(5) "water"
278: [1]=>
279: string(5) "fruit"
280: }
281: int(16)
282: bool(false)
283:
284: -- Testing fgetcsv() with file opened using r+b mode --
285: array(2) {
286: [0]=>
287: string(5) "water"
288: [1]=>
289: string(5) "fruit"
290: }
291: int(16)
292: bool(false)
293:
294: -- Testing fgetcsv() with file opened using r+t mode --
295: array(2) {
296: [0]=>
297: string(5) "water"
298: [1]=>
299: string(5) "fruit"
300: }
301: int(16)
302: bool(false)
303:
304: -- Testing fgetcsv() with file opened using a+ mode --
305: array(2) {
306: [0]=>
307: string(5) "water"
308: [1]=>
309: string(5) "fruit"
310: }
311: int(16)
312: bool(false)
313:
314: -- Testing fgetcsv() with file opened using a+b mode --
315: array(2) {
316: [0]=>
317: string(5) "water"
318: [1]=>
319: string(5) "fruit"
320: }
321: int(16)
322: bool(false)
323:
324: -- Testing fgetcsv() with file opened using a+t mode --
325: array(2) {
326: [0]=>
327: string(5) "water"
328: [1]=>
329: string(5) "fruit"
330: }
331: int(16)
332: bool(false)
333:
334: -- Testing fgetcsv() with file opened using w+ mode --
335: array(2) {
336: [0]=>
337: string(5) "water"
338: [1]=>
339: string(5) "fruit"
340: }
341: int(16)
342: bool(false)
343:
344: -- Testing fgetcsv() with file opened using w+b mode --
345: array(2) {
346: [0]=>
347: string(5) "water"
348: [1]=>
349: string(5) "fruit"
350: }
351: int(16)
352: bool(false)
353:
354: -- Testing fgetcsv() with file opened using w+t mode --
355: array(2) {
356: [0]=>
357: string(5) "water"
358: [1]=>
359: string(5) "fruit"
360: }
361: int(16)
362: bool(false)
363:
364: -- Testing fgetcsv() with file opened using x+ mode --
365: array(2) {
366: [0]=>
367: string(5) "water"
368: [1]=>
369: string(5) "fruit"
370: }
371: int(16)
372: bool(false)
373:
374: -- Testing fgetcsv() with file opened using x+b mode --
375: array(2) {
376: [0]=>
377: string(5) "water"
378: [1]=>
379: string(5) "fruit"
380: }
381: int(16)
382: bool(false)
383:
384: -- Testing fgetcsv() with file opened using x+t mode --
385: array(2) {
386: [0]=>
387: string(5) "water"
388: [1]=>
389: string(5) "fruit"
390: }
391: int(16)
392: bool(false)
393:
394: -- Testing fgetcsv() with file opened using r mode --
395: array(2) {
396: [0]=>
397: string(5) "water"
398: [1]=>
399: string(5) "fruit"
400: }
401: int(16)
402: bool(false)
403:
404: -- Testing fgetcsv() with file opened using rb mode --
405: array(2) {
406: [0]=>
407: string(5) "water"
408: [1]=>
409: string(5) "fruit"
410: }
411: int(16)
412: bool(false)
413:
414: -- Testing fgetcsv() with file opened using rt mode --
415: array(2) {
416: [0]=>
417: string(5) "water"
418: [1]=>
419: string(5) "fruit"
420: }
421: int(16)
422: bool(false)
423:
424: -- Testing fgetcsv() with file opened using r+ mode --
425: array(2) {
426: [0]=>
427: string(5) "water"
428: [1]=>
429: string(5) "fruit"
430: }
431: int(16)
432: bool(false)
433:
434: -- Testing fgetcsv() with file opened using r+b mode --
435: array(2) {
436: [0]=>
437: string(5) "water"
438: [1]=>
439: string(5) "fruit"
440: }
441: int(16)
442: bool(false)
443:
444: -- Testing fgetcsv() with file opened using r+t mode --
445: array(2) {
446: [0]=>
447: string(5) "water"
448: [1]=>
449: string(5) "fruit"
450: }
451: int(16)
452: bool(false)
453:
454: -- Testing fgetcsv() with file opened using a+ mode --
455: array(2) {
456: [0]=>
457: string(5) "water"
458: [1]=>
459: string(5) "fruit"
460: }
461: int(16)
462: bool(false)
463:
464: -- Testing fgetcsv() with file opened using a+b mode --
465: array(2) {
466: [0]=>
467: string(5) "water"
468: [1]=>
469: string(5) "fruit"
470: }
471: int(16)
472: bool(false)
473:
474: -- Testing fgetcsv() with file opened using a+t mode --
475: array(2) {
476: [0]=>
477: string(5) "water"
478: [1]=>
479: string(5) "fruit"
480: }
481: int(16)
482: bool(false)
483:
484: -- Testing fgetcsv() with file opened using w+ mode --
485: array(2) {
486: [0]=>
487: string(5) "water"
488: [1]=>
489: string(5) "fruit"
490: }
491: int(16)
492: bool(false)
493:
494: -- Testing fgetcsv() with file opened using w+b mode --
495: array(2) {
496: [0]=>
497: string(5) "water"
498: [1]=>
499: string(5) "fruit"
500: }
501: int(16)
502: bool(false)
503:
504: -- Testing fgetcsv() with file opened using w+t mode --
505: array(2) {
506: [0]=>
507: string(5) "water"
508: [1]=>
509: string(5) "fruit"
510: }
511: int(16)
512: bool(false)
513:
514: -- Testing fgetcsv() with file opened using x+ mode --
515: array(2) {
516: [0]=>
517: string(5) "water"
518: [1]=>
519: string(5) "fruit"
520: }
521: int(16)
522: bool(false)
523:
524: -- Testing fgetcsv() with file opened using x+b mode --
525: array(2) {
526: [0]=>
527: string(5) "water"
528: [1]=>
529: string(5) "fruit"
530: }
531: int(16)
532: bool(false)
533:
534: -- Testing fgetcsv() with file opened using x+t mode --
535: array(2) {
536: [0]=>
537: string(5) "water"
538: [1]=>
539: string(5) "fruit"
540: }
541: int(16)
542: bool(false)
543:
544: -- Testing fgetcsv() with file opened using r mode --
545: array(2) {
546: [0]=>
547: string(5) "water"
548: [1]=>
549: string(5) "fruit"
550: }
551: int(16)
552: bool(false)
553:
554: -- Testing fgetcsv() with file opened using rb mode --
555: array(2) {
556: [0]=>
557: string(5) "water"
558: [1]=>
559: string(5) "fruit"
560: }
561: int(16)
562: bool(false)
563:
564: -- Testing fgetcsv() with file opened using rt mode --
565: array(2) {
566: [0]=>
567: string(5) "water"
568: [1]=>
569: string(5) "fruit"
570: }
571: int(16)
572: bool(false)
573:
574: -- Testing fgetcsv() with file opened using r+ mode --
575: array(2) {
576: [0]=>
577: string(5) "water"
578: [1]=>
579: string(5) "fruit"
580: }
581: int(16)
582: bool(false)
583:
584: -- Testing fgetcsv() with file opened using r+b mode --
585: array(2) {
586: [0]=>
587: string(5) "water"
588: [1]=>
589: string(5) "fruit"
590: }
591: int(16)
592: bool(false)
593:
594: -- Testing fgetcsv() with file opened using r+t mode --
595: array(2) {
596: [0]=>
597: string(5) "water"
598: [1]=>
599: string(5) "fruit"
600: }
601: int(16)
602: bool(false)
603:
604: -- Testing fgetcsv() with file opened using a+ mode --
605: array(2) {
606: [0]=>
607: string(5) "water"
608: [1]=>
609: string(5) "fruit"
610: }
611: int(16)
612: bool(false)
613:
614: -- Testing fgetcsv() with file opened using a+b mode --
615: array(2) {
616: [0]=>
617: string(5) "water"
618: [1]=>
619: string(5) "fruit"
620: }
621: int(16)
622: bool(false)
623:
624: -- Testing fgetcsv() with file opened using a+t mode --
625: array(2) {
626: [0]=>
627: string(5) "water"
628: [1]=>
629: string(5) "fruit"
630: }
631: int(16)
632: bool(false)
633:
634: -- Testing fgetcsv() with file opened using w+ mode --
635: array(2) {
636: [0]=>
637: string(5) "water"
638: [1]=>
639: string(5) "fruit"
640: }
641: int(16)
642: bool(false)
643:
644: -- Testing fgetcsv() with file opened using w+b mode --
645: array(2) {
646: [0]=>
647: string(5) "water"
648: [1]=>
649: string(5) "fruit"
650: }
651: int(16)
652: bool(false)
653:
654: -- Testing fgetcsv() with file opened using w+t mode --
655: array(2) {
656: [0]=>
657: string(5) "water"
658: [1]=>
659: string(5) "fruit"
660: }
661: int(16)
662: bool(false)
663:
664: -- Testing fgetcsv() with file opened using x+ mode --
665: array(2) {
666: [0]=>
667: string(5) "water"
668: [1]=>
669: string(5) "fruit"
670: }
671: int(16)
672: bool(false)
673:
674: -- Testing fgetcsv() with file opened using x+b mode --
675: array(2) {
676: [0]=>
677: string(5) "water"
678: [1]=>
679: string(5) "fruit"
680: }
681: int(16)
682: bool(false)
683:
684: -- Testing fgetcsv() with file opened using x+t mode --
685: array(2) {
686: [0]=>
687: string(5) "water"
688: [1]=>
689: string(5) "fruit"
690: }
691: int(16)
692: bool(false)
693:
694: -- Testing fgetcsv() with file opened using r mode --
695: array(2) {
696: [0]=>
697: string(11) "water=fruit"
698: [1]=>
699: string(0) ""
700: }
701: int(16)
702: bool(false)
703:
704: -- Testing fgetcsv() with file opened using rb mode --
705: array(2) {
706: [0]=>
707: string(11) "water=fruit"
708: [1]=>
709: string(0) ""
710: }
711: int(16)
712: bool(false)
713:
714: -- Testing fgetcsv() with file opened using rt mode --
715: array(2) {
716: [0]=>
717: string(11) "water=fruit"
718: [1]=>
719: string(0) ""
720: }
721: int(16)
722: bool(false)
723:
724: -- Testing fgetcsv() with file opened using r+ mode --
725: array(2) {
726: [0]=>
727: string(11) "water=fruit"
728: [1]=>
729: string(0) ""
730: }
731: int(16)
732: bool(false)
733:
734: -- Testing fgetcsv() with file opened using r+b mode --
735: array(2) {
736: [0]=>
737: string(11) "water=fruit"
738: [1]=>
739: string(0) ""
740: }
741: int(16)
742: bool(false)
743:
744: -- Testing fgetcsv() with file opened using r+t mode --
745: array(2) {
746: [0]=>
747: string(11) "water=fruit"
748: [1]=>
749: string(0) ""
750: }
751: int(16)
752: bool(false)
753:
754: -- Testing fgetcsv() with file opened using a+ mode --
755: array(2) {
756: [0]=>
757: string(11) "water=fruit"
758: [1]=>
759: string(0) ""
760: }
761: int(16)
762: bool(false)
763:
764: -- Testing fgetcsv() with file opened using a+b mode --
765: array(2) {
766: [0]=>
767: string(11) "water=fruit"
768: [1]=>
769: string(0) ""
770: }
771: int(16)
772: bool(false)
773:
774: -- Testing fgetcsv() with file opened using a+t mode --
775: array(2) {
776: [0]=>
777: string(11) "water=fruit"
778: [1]=>
779: string(0) ""
780: }
781: int(16)
782: bool(false)
783:
784: -- Testing fgetcsv() with file opened using w+ mode --
785: array(2) {
786: [0]=>
787: string(11) "water=fruit"
788: [1]=>
789: string(0) ""
790: }
791: int(16)
792: bool(false)
793:
794: -- Testing fgetcsv() with file opened using w+b mode --
795: array(2) {
796: [0]=>
797: string(11) "water=fruit"
798: [1]=>
799: string(0) ""
800: }
801: int(16)
802: bool(false)
803:
804: -- Testing fgetcsv() with file opened using w+t mode --
805: array(2) {
806: [0]=>
807: string(11) "water=fruit"
808: [1]=>
809: string(0) ""
810: }
811: int(16)
812: bool(false)
813:
814: -- Testing fgetcsv() with file opened using x+ mode --
815: array(2) {
816: [0]=>
817: string(11) "water=fruit"
818: [1]=>
819: string(0) ""
820: }
821: int(16)
822: bool(false)
823:
824: -- Testing fgetcsv() with file opened using x+b mode --
825: array(2) {
826: [0]=>
827: string(11) "water=fruit"
828: [1]=>
829: string(0) ""
830: }
831: int(16)
832: bool(false)
833:
834: -- Testing fgetcsv() with file opened using x+t mode --
835: array(2) {
836: [0]=>
837: string(11) "water=fruit"
838: [1]=>
839: string(0) ""
840: }
841: int(16)
842: bool(false)
843:
844: -- Testing fgetcsv() with file opened using r mode --
845: array(1) {
846: [0]=>
847: string(14) "water-fruitair"
848: }
849: int(18)
850: bool(false)
851:
852: -- Testing fgetcsv() with file opened using rb mode --
853: array(1) {
854: [0]=>
855: string(14) "water-fruitair"
856: }
857: int(18)
858: bool(false)
859:
860: -- Testing fgetcsv() with file opened using rt mode --
861: array(1) {
862: [0]=>
863: string(14) "water-fruitair"
864: }
865: int(18)
866: bool(false)
867:
868: -- Testing fgetcsv() with file opened using r+ mode --
869: array(1) {
870: [0]=>
871: string(14) "water-fruitair"
872: }
873: int(18)
874: bool(false)
875:
876: -- Testing fgetcsv() with file opened using r+b mode --
877: array(1) {
878: [0]=>
879: string(14) "water-fruitair"
880: }
881: int(18)
882: bool(false)
883:
884: -- Testing fgetcsv() with file opened using r+t mode --
885: array(1) {
886: [0]=>
887: string(14) "water-fruitair"
888: }
889: int(18)
890: bool(false)
891:
892: -- Testing fgetcsv() with file opened using a+ mode --
893: array(1) {
894: [0]=>
895: string(14) "water-fruitair"
896: }
897: int(18)
898: bool(false)
899:
900: -- Testing fgetcsv() with file opened using a+b mode --
901: array(1) {
902: [0]=>
903: string(14) "water-fruitair"
904: }
905: int(18)
906: bool(false)
907:
908: -- Testing fgetcsv() with file opened using a+t mode --
909: array(1) {
910: [0]=>
911: string(14) "water-fruitair"
912: }
913: int(18)
914: bool(false)
915:
916: -- Testing fgetcsv() with file opened using w+ mode --
917: array(1) {
918: [0]=>
919: string(14) "water-fruitair"
920: }
921: int(18)
922: bool(false)
923:
924: -- Testing fgetcsv() with file opened using w+b mode --
925: array(1) {
926: [0]=>
927: string(14) "water-fruitair"
928: }
929: int(18)
930: bool(false)
931:
932: -- Testing fgetcsv() with file opened using w+t mode --
933: array(1) {
934: [0]=>
935: string(14) "water-fruitair"
936: }
937: int(18)
938: bool(false)
939:
940: -- Testing fgetcsv() with file opened using x+ mode --
941: array(1) {
942: [0]=>
943: string(14) "water-fruitair"
944: }
945: int(18)
946: bool(false)
947:
948: -- Testing fgetcsv() with file opened using x+b mode --
949: array(1) {
950: [0]=>
951: string(14) "water-fruitair"
952: }
953: int(18)
954: bool(false)
955:
956: -- Testing fgetcsv() with file opened using x+t mode --
957: array(1) {
958: [0]=>
959: string(14) "water-fruitair"
960: }
961: int(18)
962: bool(false)
963:
964: -- Testing fgetcsv() with file opened using r mode --
965: array(3) {
966: [0]=>
967: string(11) "water-fruit"
968: [1]=>
969: string(3) "air"
970: [2]=>
971: string(0) ""
972: }
973: int(22)
974: bool(false)
975:
976: -- Testing fgetcsv() with file opened using rb mode --
977: array(3) {
978: [0]=>
979: string(11) "water-fruit"
980: [1]=>
981: string(3) "air"
982: [2]=>
983: string(0) ""
984: }
985: int(22)
986: bool(false)
987:
988: -- Testing fgetcsv() with file opened using rt mode --
989: array(3) {
990: [0]=>
991: string(11) "water-fruit"
992: [1]=>
993: string(3) "air"
994: [2]=>
995: string(0) ""
996: }
997: int(22)
998: bool(false)
999:
1000: -- Testing fgetcsv() with file opened using r+ mode --
1001: array(3) {
1002: [0]=>
1003: string(11) "water-fruit"
1004: [1]=>
1005: string(3) "air"
1006: [2]=>
1007: string(0) ""
1008: }
1009: int(22)
1010: bool(false)
1011:
1012: -- Testing fgetcsv() with file opened using r+b mode --
1013: array(3) {
1014: [0]=>
1015: string(11) "water-fruit"
1016: [1]=>
1017: string(3) "air"
1018: [2]=>
1019: string(0) ""
1020: }
1021: int(22)
1022: bool(false)
1023:
1024: -- Testing fgetcsv() with file opened using r+t mode --
1025: array(3) {
1026: [0]=>
1027: string(11) "water-fruit"
1028: [1]=>
1029: string(3) "air"
1030: [2]=>
1031: string(0) ""
1032: }
1033: int(22)
1034: bool(false)
1035:
1036: -- Testing fgetcsv() with file opened using a+ mode --
1037: array(3) {
1038: [0]=>
1039: string(11) "water-fruit"
1040: [1]=>
1041: string(3) "air"
1042: [2]=>
1043: string(0) ""
1044: }
1045: int(22)
1046: bool(false)
1047:
1048: -- Testing fgetcsv() with file opened using a+b mode --
1049: array(3) {
1050: [0]=>
1051: string(11) "water-fruit"
1052: [1]=>
1053: string(3) "air"
1054: [2]=>
1055: string(0) ""
1056: }
1057: int(22)
1058: bool(false)
1059:
1060: -- Testing fgetcsv() with file opened using a+t mode --
1061: array(3) {
1062: [0]=>
1063: string(11) "water-fruit"
1064: [1]=>
1065: string(3) "air"
1066: [2]=>
1067: string(0) ""
1068: }
1069: int(22)
1070: bool(false)
1071:
1072: -- Testing fgetcsv() with file opened using w+ mode --
1073: array(3) {
1074: [0]=>
1075: string(11) "water-fruit"
1076: [1]=>
1077: string(3) "air"
1078: [2]=>
1079: string(0) ""
1080: }
1081: int(22)
1082: bool(false)
1083:
1084: -- Testing fgetcsv() with file opened using w+b mode --
1085: array(3) {
1086: [0]=>
1087: string(11) "water-fruit"
1088: [1]=>
1089: string(3) "air"
1090: [2]=>
1091: string(0) ""
1092: }
1093: int(22)
1094: bool(false)
1095:
1096: -- Testing fgetcsv() with file opened using w+t mode --
1097: array(3) {
1098: [0]=>
1099: string(11) "water-fruit"
1100: [1]=>
1101: string(3) "air"
1102: [2]=>
1103: string(0) ""
1104: }
1105: int(22)
1106: bool(false)
1107:
1108: -- Testing fgetcsv() with file opened using x+ mode --
1109: array(3) {
1110: [0]=>
1111: string(11) "water-fruit"
1112: [1]=>
1113: string(3) "air"
1114: [2]=>
1115: string(0) ""
1116: }
1117: int(22)
1118: bool(false)
1119:
1120: -- Testing fgetcsv() with file opened using x+b mode --
1121: array(3) {
1122: [0]=>
1123: string(11) "water-fruit"
1124: [1]=>
1125: string(3) "air"
1126: [2]=>
1127: string(0) ""
1128: }
1129: int(22)
1130: bool(false)
1131:
1132: -- Testing fgetcsv() with file opened using x+t mode --
1133: array(3) {
1134: [0]=>
1135: string(11) "water-fruit"
1136: [1]=>
1137: string(3) "air"
1138: [2]=>
1139: string(0) ""
1140: }
1141: int(22)
1142: bool(false)
1143:
1144: -- Testing fgetcsv() with file opened using r mode --
1145: array(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: }
1159: int(24)
1160: bool(false)
1161:
1162: -- Testing fgetcsv() with file opened using rb mode --
1163: array(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: }
1177: int(24)
1178: bool(false)
1179:
1180: -- Testing fgetcsv() with file opened using rt mode --
1181: array(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: }
1195: int(24)
1196: bool(false)
1197:
1198: -- Testing fgetcsv() with file opened using r+ mode --
1199: array(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: }
1213: int(24)
1214: bool(false)
1215:
1216: -- Testing fgetcsv() with file opened using r+b mode --
1217: array(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: }
1231: int(24)
1232: bool(false)
1233:
1234: -- Testing fgetcsv() with file opened using r+t mode --
1235: array(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: }
1249: int(24)
1250: bool(false)
1251:
1252: -- Testing fgetcsv() with file opened using a+ mode --
1253: array(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: }
1267: int(24)
1268: bool(false)
1269:
1270: -- Testing fgetcsv() with file opened using a+b mode --
1271: array(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: }
1285: int(24)
1286: bool(false)
1287:
1288: -- Testing fgetcsv() with file opened using a+t mode --
1289: array(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: }
1303: int(24)
1304: bool(false)
1305:
1306: -- Testing fgetcsv() with file opened using w+ mode --
1307: array(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: }
1321: int(24)
1322: bool(false)
1323:
1324: -- Testing fgetcsv() with file opened using w+b mode --
1325: array(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: }
1339: int(24)
1340: bool(false)
1341:
1342: -- Testing fgetcsv() with file opened using w+t mode --
1343: array(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: }
1357: int(24)
1358: bool(false)
1359:
1360: -- Testing fgetcsv() with file opened using x+ mode --
1361: array(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: }
1375: int(24)
1376: bool(false)
1377:
1378: -- Testing fgetcsv() with file opened using x+b mode --
1379: array(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: }
1393: int(24)
1394: bool(false)
1395:
1396: -- Testing fgetcsv() with file opened using x+t mode --
1397: array(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: }
1411: int(24)
1412: bool(false)
1413: Done