<?php
final class TimeoutProbe {
    private float $timeout = 3.0;

    public function command(?float $timeout = null): string {
        return $this->readUntilIdle($timeout ?? $this->timeout);
    }

    private function readUntilIdle(float $timeout): string {
        return 'timeout=' . $timeout;
    }
}

$probe = new TimeoutProbe();
echo $probe->command(null), PHP_EOL;
echo $probe->command(1.5), PHP_EOL;
