File::__get()

Proxy for missing properties.

Table of Contents
  1. Description
  2. Example

Description

File::__get(string $key): mixed;

This method will be called when a public property is not available on class File. By default, this method will first try to find an existing public method and call it with empty argument.

Example

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

$asdf = $file->asdf; // Returns `null` because property `asdf` does not exist
$name = $file->name; // Returns `$file->name()` because method `name()` does exist

File::__get()

Proxy for missing properties.

File::size()

Gets the file sizes in human readable string format.