gettype
and resources
PHP’s gettype()
function can be used to query the
current type of a variable. Prior to PHP 7.2, there was no
information kept on resources after they got closed. So any attempt
to fetch the type of a variable holding a closed resource simply
returned unknown type
. Since PHP 7.2, the information
is kept and consequentially the type is now returned as
resource (closed)
.