1--TEST-- 2SplFileObject::fgetcsv with alternative enclosure 3--FILE-- 4<?php 5$fp = fopen('SplFileObject__fgetcsv4.csv', 'w+'); 6fputcsv( 7 $fp, 8 [ 9 'field1', 10 'field2', 11 'field3', 12 5, 13 ], 14 enclosure: '"', 15 escape: '', 16); 17fclose($fp); 18 19$fo = new SplFileObject('SplFileObject__fgetcsv4.csv'); 20$fo->setCsvControl(escape: ''); 21var_dump($fo->fgetcsv(enclosure: '"')); 22?> 23--CLEAN-- 24<?php 25unlink('SplFileObject__fgetcsv4.csv'); 26?> 27--EXPECT-- 28array(4) { 29 [0]=> 30 string(6) "field1" 31 [1]=> 32 string(6) "field2" 33 [2]=> 34 string(6) "field3" 35 [3]=> 36 string(1) "5" 37} 38