ComponentsFileSystemWatcher::isClosed

FileSystemWatcher::isClosed

(PHP 8.6+, True Async 1.0)

php
public FileSystemWatcher::isClosed(): bool

Returns true if watching has been stopped --- close() was called, the scope was cancelled, or an error occurred.

Parameters

No parameters.

Return Value

true --- the watcher is closed, false --- it is active.

Examples

Example #1

php
<?php
use Async\FileSystemWatcher;

$watcher = new FileSystemWatcher('/tmp/dir');

var_dump($watcher->isClosed()); // false

$watcher->close();

var_dump($watcher->isClosed()); // true
?>

See Also