PHP >= 7.4 本模块弃用,请使用 Async 模块。
<?php
$process = new Phalcon\Process\Proc('ping localhost', __DIR__.'/run.pid');
$process->reStart();
$ret = $process->handle(function($pipe, $data) {
// on read
echo $data;
}, function($pipe){
// on send
}, function($pipe, $error){
// on error
}, function(){
// on timeout
});