while (true) {
    echo ;
    if ($kelvin = trim(fgets(STDIN))) {
        if ($kelvin == 'q') {
            echo 'quitting';
            break;
        }
        if (is_numeric($kelvin)) {
            $kelvin = floatVal($kelvin);
            if ($kelvin >= 0) {
                printf(, $kelvin);
                printf(, $kelvin - 273.15);
                printf(, $kelvin * 1.8 - 459.67);
                printf(, $kelvin * 1.8);
            } else printf(, $kelvin);
        }
    }
}