The following solution patches \@iiiparbox to get the height in the second parameter. The value is stored in the dimension register \parboxheight.
If the height is not set, LaTeX uses \relax for this parameter.
Then, \parboxheight is set to zero. If you want to know, whether the
height parameter was set the optional argument, an additional switch
can be used.
Example:
\documentclass{article}
\newdimen\parboxheight
\makeatletter
\newcommand*{\org@iiiparbox}{}
\let\org@iiiparbox\@iiiparbox
\renewcommand*{\@iiiparbox}[2]{%
\ifx\relax#2%
\setlength{\parboxheight}{0pt}%
\else
\setlength{\parboxheight}{#2}%
\fi
\org@iiiparbox{#1}{#2}%
}
\makeatother
\begin{document}
\setlength{\fboxsep}{-\fboxrule}
\fbox{\parbox{100pt}{Some text, some more text, and \the\linewidth}}
\fbox{%
\parbox[][80pt][t]{100pt}{%
\raggedright
Some text, some more text, and width \the\linewidth, %
and the height \the\parboxheight.%
}%
}
\end{document}

With switch:
\documentclass{article}
\newif\ifparboxheight
\newdimen\parboxheight
\makeatletter
\newcommand*{\org@iiiparbox}{}
\let\org@iiiparbox\@iiiparbox
\renewcommand*{\@iiiparbox}[2]{%
\ifx\relax#2%
\parboxheightfalse
\setlength{\parboxheight}{0pt}%
\else
\parboxheighttrue
\setlength{\parboxheight}{#2}%
\fi
\org@iiiparbox{#1}{#2}%
}
\makeatother
\begin{document}
\setlength{\fboxsep}{-\fboxrule}
\newcommand*{\TestText}{%
\raggedright
Some text, some more text. The width is \the\linewidth
\ifparboxheight
\ and the height is \the\parboxheight
\fi
.%
}
\fbox{\parbox{100pt}{\TestText}}
\fbox{\parbox[][80pt][t]{100pt}{\TestText}}
\end{document}

\htcan be used. – Display Name Aug 18 '17 at 16:27@parboxtowill not be useful, then. But another solution might involve doing\let\Lparbox=\parboxand then making a new command\parboxwhich squirrels away the height argument, if present, and then invokes\Lparbox. – Harald Hanche-Olsen Aug 18 '17 at 16:42