cvs: php4 /ext/standard basic_functions.c
| From: | Jeroen van Wolffelaar | Date: | Sat, 22 Sep 2001 01:39:14 +0000 |
| Subject: | cvs: php4 /ext/standard basic_functions.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-7508@lists.php.net to get a copy of this message | ||
jeroen Fri Sep 21 21:39:14 2001 EDT
Modified files:
/php4/ext/standard basic_functions.c
Log:
Let settype also accept 'int', 'bool', 'float' and 'null'
@Let settype also accept 'int', 'bool', 'float' and 'null'
(Jeroen)
Index: php4/ext/standard/basic_functions.c
diff -u php4/ext/standard/basic_functions.c:1.399 php4/ext/standard/basic_functions.c:1.400
--- php4/ext/standard/basic_functions.c:1.399 Fri Sep 21 17:59:22 2001
+++ php4/ext/standard/basic_functions.c Fri Sep 21 21:39:14 2001
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: basic_functions.c,v 1.399 2001/09/21 21:59:22 hholzgra Exp $ */
+/* $Id: basic_functions.c,v 1.400 2001/09/22 01:39:14 jeroen Exp $ */
#include "php.h"
#include "php_main.h"
@@ -1443,7 +1443,11 @@
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 @@
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;