php8.5
Home/ Manual/ reference / dir/ The Directory class

The Directory class

Instances of Directory are created by calling the dir function, not by the new operator.

Intro

Instances of Directory are created by calling the dir() function, not by the new operator.

Class synopsis

final Directory { }

Properties

path

The directory that was opened.

handle

Can be used with other directory functions such as readdir(), rewinddir() and closedir().

Changelog

VersionDescription
8.5.0The class is now final.
8.1.0The path and handle properties are now readonly.

Directory

In this section

Source: reference/dir/directory.xml · from the official PHP manual (php/doc-en)