summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXinchen Hui <laruence@php.net>2014-06-26 18:29:25 +0800
committerXinchen Hui <laruence@php.net>2014-06-26 18:29:25 +0800
commit46f4e9b56e39c1b178ab84e4449eaf851116a6ec (patch)
tree2fcfcaac1fa57cf27fe962f9d56f8e5145e27467
parentf75c04ac8da837da1a264eb0edbe383ae71ae199 (diff)
downloadphp-git-46f4e9b56e39c1b178ab84e4449eaf851116a6ec.tar.gz
IS_OBJECT and IS_RESOURCE is obviously exclusive
-rw-r--r--ext/standard/type.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/ext/standard/type.c b/ext/standard/type.c
index a42dd0bd0b..72f1660932 100644
--- a/ext/standard/type.c
+++ b/ext/standard/type.c
@@ -218,16 +218,16 @@ static void php_is_type(INTERNAL_FUNCTION_PARAMETERS, int type)
if (Z_TYPE_P(arg) == type) {
if (type == IS_OBJECT) {
zend_class_entry *ce;
- if(Z_OBJ_HT_P(arg)->get_class_entry == NULL) {
- /* if there's no get_class_entry it's not a PHP object, so it can't be INCOMPLETE_CLASS */
+ if (Z_OBJ_HT_P(arg)->get_class_entry == NULL) {
+ /* if there's no get_class_entry it's not a PHP object, so it can't be INCOMPLETE_CLASS */
RETURN_TRUE;
}
ce = Z_OBJCE_P(arg);
- if (!strcmp(ce->name->val, INCOMPLETE_CLASS)) {
+ if (ce->name->len == sizeof(INCOMPLETE_CLASS) - 1
+ && !strncmp(ce->name->val, INCOMPLETE_CLASS, ce->name->len)) {
RETURN_FALSE;
}
- }
- if (type == IS_RESOURCE) {
+ } else if (type == IS_RESOURCE) {
const char *type_name = zend_rsrc_list_get_rsrc_type(Z_RES_P(arg) TSRMLS_CC);
if (!type_name) {
RETURN_FALSE;