# How to access name of environment in its own definition [duplicate]

How can I get access to the name of an environment from within its own definition?

Consider, e.g.:

\documentclass{article}
\newenvironment{test}{This is som text from environment \printname :}{}
\begin{document}
\begin{test}
text
\end{test}
\end{document}


I would like \printname to give the name of the environment, such that I get the following output: