Hi Tony,

Thankyou very much for your explanation. This now clears my doubt about EOF
and when exactly do we get EOF.

Regards
Nikhil

On 8/9/07, Antony Dovgal <[EMAIL PROTECTED]> wrote:
>
> On 09.08.2007 10:14, Nikhil Gupta wrote:
> > Hi Tony,
> >
> > The purpose of testcase (fgetcsv_variation14.phpt) is to read from end
> of
> > file.The use of feof() in the testcase is to check for the file pointer
> > pointing to end of file. This check is required to confirm the position
> of
> > file pointer before and after the read  function by fgetcsv().
> > I think this check is required here.
>
> I don't understand why it's required to test feof() in fgetcsv() tests
> (perhaps you need
> a separate test for feof() in this case?) and the expected result of the
> check is definitely wrong.
>
> fgetcsv() reads up to the end of line, which happens to be the end of file
> too,
> but feof() returns false because the function stopped right in the end, it
> didn't try to
> read more, so it didn't get EOF or truncated data.
> feof() returns bool(false) in this case in all recent PHP versions (4.4,
> 5.2.3, 5.2), so I dunno
> why the tests expect bool(true).
>
> --
> Wbr,
> Antony Dovgal
>

Reply via email to