<?php$http = new swoole_http_server("0.0.0.0", 9512);
$http->on("start", function ($server) { echo "Swoole http server is started at http://127.0.0.1:9512\n";
});
$http->on("request", function (\swoole_http_request $request, \swoole_http_response $response) { static $a= 0;
$a++;
$response->write("a:".$a.PHP_EOL);
});
$http->start();瀏覽器請(qǐng)求 http://127.0.0.1:9512第一次輸出 a:1第二次輸出 a:3第三次輸出 a:5第四次輸出 a:7環(huán)境:| PHP | 7.1.15 || Swoole | 4.0.0 || Laravel Framework | 5.5.26
swoole static疑惑
慕工程0101907
2018-11-13 13:42:31