TypePHP 编译器
https://swoole.com/aot/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
41 lines
784 B
41 lines
784 B
--TEST--
|
|
place-holder
|
|
--FILE--
|
|
<?php
|
|
class Select {
|
|
public function onReadable($stream, callable $func): void
|
|
{
|
|
$func($stream);
|
|
}
|
|
}
|
|
class Worker {
|
|
public static ?EventInterface $globalEvent = null;
|
|
protected $mainSocket;
|
|
|
|
function __construct() {
|
|
$this->mainSocket = 'tcp-stream';
|
|
}
|
|
|
|
public function resumeAccept()
|
|
{
|
|
static::$globalEvent->onReadable($this->mainSocket, $this->acceptUdpConnection(...));
|
|
}
|
|
|
|
protected function acceptUdpConnection($stream)
|
|
{
|
|
var_dump(__METHOD__);
|
|
var_dump($stream);
|
|
}
|
|
}
|
|
|
|
function main()
|
|
{
|
|
$obj = new Worker;
|
|
Worker::$globalEvent = new Select;
|
|
$obj->resumeAccept();
|
|
}
|
|
?>
|
|
--EXPECT--
|
|
string(27) "Worker::acceptUdpConnection"
|
|
string(10) "tcp-stream"
|
|
|
|
|