summaryrefslogtreecommitdiff
path: root/ext/standard/basic_functions.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/standard/basic_functions.c')
-rw-r--r--ext/standard/basic_functions.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c
index 445036155d..6fed8a31bb 100644
--- a/ext/standard/basic_functions.c
+++ b/ext/standard/basic_functions.c
@@ -1266,6 +1266,9 @@ PHP_FUNCTION(gettype)
case IS_LONG:
RETVAL_STRING("integer",1);
break;
+ case IS_RESOURCE:
+ RETVAL_STRING("resource",1);
+ break;
case IS_DOUBLE:
RETVAL_STRING("double",1);
break;
@@ -1318,6 +1321,11 @@ PHP_FUNCTION(settype)
convert_to_array(var);
} else if (!strcasecmp(new_type, "object")) {
convert_to_object(var);
+ } else if (!strcasecmp(new_type, "boolean")) {
+ convert_to_boolean(var);
+ } else if (!strcasecmp(new_type, "resource")) {
+ php3_error(E_WARNING, "settype: cannot convert to resource type");
+ RETURN_FALSE;
} else {
php3_error(E_WARNING, "settype: invalid type");
RETURN_FALSE;