mirror of
https://github.com/php/php-src.git
synced 2024-09-22 02:17:32 +00:00
gettype(): Use "resource (closed)" instead of "unknown type"
This commit is contained in:
parent
0374a98e14
commit
34824b70f8
@ -20,6 +20,8 @@ PHP 7.1 UPGRADE NOTES
|
||||
========================================
|
||||
|
||||
- Core:
|
||||
. gettype() will now return "resource (closed)" instead of "unknown type" for
|
||||
closed resources.
|
||||
|
||||
========================================
|
||||
2. New Features
|
||||
|
@ -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)
|
||||
|
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user