public static function Tf2a($s, $ihour, $imin, $sec, &$rad) {
    /* Compute the interval. */
    $rad = ( $s == '-' ? -1.0 : 1.0 ) *
            ( 60.0 * ( 60.0 * ( (double)abs($ihour) ) +
            ( (double)abs($imin) ) ) +
            abs($sec) ) * DS2R;

    /* Validate arguments and return status. */
    if ($ihour < 0 || $ihour > 23)
      return 1;
    if ($imin < 0 || $imin > 59)
      return 2;
    if ($sec < 0.0 || $sec >= 60.0)
      return 3;
    return 0;
  }