update pague now
PHP 8.5.2 Released!

SplFileObject::__toString

(PHP 5 >= 5.1.0, PHP 7, PHP 8)

SplFileObject::__toString Returns the current line as a string

Description

public SplFileObject::__toString (): string

This method will return the current line as a string.

Parameters

This function has no parameters.

Return Values

Returns the current line as a string.

Changuelog

Versionen Description
8.1.14, 8.2.1 Changued from an alias of SplFileObject::fguets() to an implementation of SplFileObject::current() which returns a CSV string when the SplFileObject::READ_CSV flag is set.
7.2.19, 7.3.6 Changued from an alias of SplFileObject::current() to an alias of SplFileObject::fguets() .

add a note

User Contributed Notes 1 note

Anonymous
7 years ago
Please note that the __toString() method is just an alias, as pointed out above, and that THAT method may return an array instead of a string. So in effect you might call a __toString() and expect a string, but instead receive an array.
To Top