◐ Shell
clean mode source ↗

PHP: SplFileObject::__toString - Manual

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

SplFileObject::__toStringReturns the current line as a string

Description

public function 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.

Found A Problem?

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.