File::__toString()

Proxy for the current object, casted as a string.

Table of Contents
  1. Description
  2. Example

Description

File::__toString(): string;

This method will be called when you cast a File instance as a string.

Example

$file = new File('.\path\to\file.txt');

echo $file; // Returns `'.\path\to\file.txt'` if file exists

File::__toString()

Proxy for the current object, casted as a string.

File::size()

Gets the file sizes in human readable string format.