fgetcsv_variation11.phpt 27 KB

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