PHP 7.0.6 Released

SplFileInfo::getSize

(PHP 5 >= 5.1.2, PHP 7)

SplFileInfo::getSizeGets file size

Beschreibung

public int SplFileInfo::getSize ( void )

Returns the filesize in bytes for the file referenced.

Parameter-Liste

Diese Funktion hat keine Parameter.

R├╝ckgabewerte

The filesize in bytes.

Fehler/Exceptions

A RuntimeException will be thrown if the file does not exist or an error occurs.

Siehe auch

add a note add a note

User Contributed Notes 3 notes

up
1
franssen dot roland at gmail dot com
5 years ago
Seems to return FALSE if file does not exists... (PHP 5.3.4)
up
0
contact at socialdevelop dot biz
1 month ago
if use it as SplFileInfo::getSize - it return false if file not found
if use it as SplFileObject::getSize - it generate RuntimeException: SplFileObject::__construct(my-file): failed to open stream: No such file or directory
up
0
Anonymous
1 month ago
Check http://php.net/manual/en/function.filesize.php#115792 for fast and reliable version of filesize for files >2gb on 32 bit systems.
To Top