cvs: /php4/ext/standard basic_functions.c /php4/tests testobj

From: Date: Sun, 01 Aug 1999 17:56:09 +0000
Subject: cvs: /php4/ext/standard basic_functions.c /php4/tests testobj
Groups: php.version4 
Request: Send a blank email to php-version4+get-3033@lists.php.net to get a copy of this message
andi Sun Aug 1 13:56:09 1999 EDT Modified files: /php4/ext/standard basic_functions.c /php4/tests testobj Log: Support resource type in gettype() Index: php4/ext/standard/basic_functions.c diff -u php4/ext/standard/basic_functions.c:1.63 php4/ext/standard/basic_functions.c:1.64 --- php4/ext/standard/basic_functions.c:1.63 Thu Jul 29 00:03:03 1999 +++ php4/ext/standard/basic_functions.c Sun Aug 1 13:56:09 1999 @@ -1266,6 +1266,9 @@ 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 @@ 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; Index: php4/tests/testobj diff -u php4/tests/testobj:1.4 php4/tests/testobj:1.5 --- php4/tests/testobj:1.4 Thu Jul 29 00:03:03 1999 +++ php4/tests/testobj Sun Aug 1 13:56:09 1999 @@ -2,7 +2,7 @@ define("endl","\n"); -if (1) { +//if (1) { class foobar { function foobar() { $this->initialized = 1; @@ -12,7 +12,7 @@ class barbara extends foobar { }; -} +//} $name = "foobar"; $foo = new $name; // or die("Unable to construct foobar\n");

« previous php.version4 (#3033) next »