summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ext/standard/basic_functions.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c
index 5713c61598..8c6cdf8d0e 100644
--- a/ext/standard/basic_functions.c
+++ b/ext/standard/basic_functions.c
@@ -1443,7 +1443,11 @@ PHP_FUNCTION(settype)
if (!strcasecmp(new_type, "integer")) {
convert_to_long(*var);
- } else if (!strcasecmp(new_type, "double")) {
+ } else if (!strcasecmp(new_type, "int")) {
+ convert_to_long(*var);
+ } else if (!strcasecmp(new_type, "float")) {
+ convert_to_double(*var);
+ } else if (!strcasecmp(new_type, "double")) { /* deprecated */
convert_to_double(*var);
} else if (!strcasecmp(new_type, "string")) {
convert_to_string(*var);
@@ -1451,8 +1455,12 @@ PHP_FUNCTION(settype)
convert_to_array(*var);
} else if (!strcasecmp(new_type, "object")) {
convert_to_object(*var);
+ } else if (!strcasecmp(new_type, "bool")) {
+ convert_to_boolean(*var);
} else if (!strcasecmp(new_type, "boolean")) {
convert_to_boolean(*var);
+ } else if (!strcasecmp(new_type, "null")) {
+ convert_to_null(*var);
} else if (!strcasecmp(new_type, "resource")) {
php_error(E_WARNING, "settype: cannot convert to resource type");
RETURN_FALSE;