diff --git a/ext/standard/tests/general_functions/type.phpt b/ext/standard/tests/general_functions/type.phpt index eb6f0672fea02..df2dbaf461ed9 100644 --- a/ext/standard/tests/general_functions/type.phpt +++ b/ext/standard/tests/general_functions/type.phpt @@ -63,7 +63,7 @@ string(6) "double" string(4) "NULL" string(7) "boolean" string(6) "string" -string(12) "unknown type" +string(17) "resource (closed)" string(8) "resource" string(6) "object" bool(true) diff --git a/ext/standard/type.c b/ext/standard/type.c index 3f97bc86883d7..59268c726d762 100644 --- a/ext/standard/type.c +++ b/ext/standard/type.c @@ -59,17 +59,6 @@ PHP_FUNCTION(gettype) case IS_OBJECT: RETVAL_STRING("object"); - /* - { - char *result; - int res_len; - - res_len = sizeof("object of type ")-1 + Z_OBJCE_P(arg)->name_length; - spprintf(&result, 0, "object of type %s", Z_OBJCE_P(arg)->name); - RETVAL_STRINGL(result, res_len); - efree(result); - } - */ break; case IS_RESOURCE: @@ -78,8 +67,10 @@ PHP_FUNCTION(gettype) if (type_name) { RETVAL_STRING("resource"); - break; + } else { + RETVAL_STRING("resource (closed)"); } + break; } default: