File::__serialize()

Provides data to be serialized.

Table of Contents
  1. Description
  2. Example

Description

File::__serialize(): array;

This method will be called when a File instance is serialized using the built-in PHP serialize() function.

Example

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

echo serialize($file); // Returns `'O:4:"File":1:{s:4:"path";s:18:".\path\to\file.txt";}'`

File::__serialize()

Provides data to be serialized.

File::size()

Gets the file sizes in human readable string format.