Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Get string length
<?php strlen(string $string): int
<?php         return;

    }



    echo strlen($chunk) . ' bytes' . PHP_EOL;

});
<?php $data = (isset($argv[1]) ? $argv[1] : 'y') . "\n";




$data = str_repeat($data, round(200000 / strlen($data)));



if (!defined('STDOUT') || stream_set_blocking(STDOUT, false) !== true) {

    fwrite(STDERR, 'ERROR: Unable to set STDOUT non-blocking (not CLI or Windows?)' . PHP_EOL);
<?php     $data = "HTTP/1.1 200 OK\r\nContent-Length: 3\r\n\r\nHi\n";

    Loop::addWriteStream($conn, function ($conn) use (&$data) {

        $written = fwrite($conn, $data);

        if ($written === strlen($data)) {

            fclose($conn);

            Loop::removeWriteStream($conn);

        } else {