fgetcsv_variation7.phpt 21 KB

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