public static function toVariable($str)
  {
    // Remove dashes and underscores, then convert to camel case.
    $str = self::toSpaceSeparated($str);
    $str = self::toCamelCase($str);

    // Remove leading digits.
    $str = preg_replace('#^[0-9]+.*$#', '', $str);

    // Lowercase the first character.
    $first = substr($str, 0, 1);
    $first = mb_strtolower($first);

    // Replace the first character with the lowercase character.
    $str = substr_replace($str, $first, 0, 1);

    return $str;
  }