Overview
KB
Technical FAQ
PHP Manual
CSS2 Manual
HTML Manual
JS Guide
JS Reference
PhpDock Manual
Nu-Coder Manual
PhpExpress Manual
PHP Joomla
Development
Learn PHP
 
<Swoole\Async::readSwoole\Async::set>
^Swoole\AsyncLast updated: Mon, 26 Oct 2026

Swoole\Async::readFile

(PECL swoole >= 1.9.0)

Swoole\Async::readFile — Read a file asynchronously.

Description

public static function Swoole\Async::readFile(string $filename, callable $callback): void

Parameters

filename

The filename of the file being read.

callback
function callback(string $filename, string $content): mixed
filename

The name of the file.

content

The content read from the file.


<Swoole\Async::readSwoole\Async::set>
^Swoole\AsyncLast updated: Mon, 26 Oct 2026