Swoole static is confused

<?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;
    $aPP;
    $response->write("a:".$a.PHP_EOL);
});
$http->start();

browser request http://127.0.0.1:9512
first output
second output
third output
fourth output

Environment:
| PHP | 7.1.15 |
| Swoole | 4.0.0 |
| Laravel Framework | 5.5.26

Aug.30,2021

originally wanted to delete the question, see the prestige-1 feeling to make up the answer. The normal expected output of
is
br 1

3
.

the problem lies in the browser request. If you use chrome request, chrome will send a favicon.ico request in addition to the normal request.

Menu