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