summaryrefslogtreecommitdiff
path: root/ext/standard
diff options
context:
space:
mode:
Diffstat (limited to 'ext/standard')
-rw-r--r--ext/standard/incomplete_class.c12
-rw-r--r--ext/standard/php_incomplete_class.h5
-rw-r--r--ext/standard/type.c8
3 files changed, 16 insertions, 9 deletions
diff --git a/ext/standard/incomplete_class.c b/ext/standard/incomplete_class.c
index ee49154c17..ef0e2116c2 100644
--- a/ext/standard/incomplete_class.c
+++ b/ext/standard/incomplete_class.c
@@ -30,12 +30,10 @@
"you are trying to operate on was loaded _before_ " \
"the session was started"
-#define INCOMPLETE_CLASS "__PHP_Incomplete_Class"
-#define MAGIC_MEMBER "__PHP_Incomplete_Class_Name"
/* {{{ incomplete_class_message
*/
-static void incomplete_class_message(zend_property_reference *ref)
+static void incomplete_class_message(zend_property_reference *ref, int error_type)
{
char buf[1024];
char *class_name;
@@ -49,7 +47,7 @@ static void incomplete_class_message(zend_property_reference *ref)
efree(class_name);
- php_error(E_ERROR, "%s", buf);
+ php_error(error_type, "%s", buf);
}
/* }}} */
@@ -57,7 +55,7 @@ static void incomplete_class_message(zend_property_reference *ref)
*/
static void incomplete_class_call_func(INTERNAL_FUNCTION_PARAMETERS, zend_property_reference *property_reference)
{
- incomplete_class_message(property_reference);
+ incomplete_class_message(property_reference, E_ERROR);
}
/* }}} */
@@ -65,7 +63,7 @@ static void incomplete_class_call_func(INTERNAL_FUNCTION_PARAMETERS, zend_proper
*/
static int incomplete_class_set_property(zend_property_reference *property_reference, zval *value)
{
- incomplete_class_message(property_reference);
+ incomplete_class_message(property_reference, E_NOTICE);
/* does not reach this point */
return (0);
@@ -78,7 +76,7 @@ static zval incomplete_class_get_property(zend_property_reference *property_refe
{
zval foo;
- incomplete_class_message(property_reference);
+ incomplete_class_message(property_reference, E_NOTICE);
/* does not reach this point */
memset(&foo, 0, sizeof(zval)); /* shut warnings up */
diff --git a/ext/standard/php_incomplete_class.h b/ext/standard/php_incomplete_class.h
index 90ab2a17c9..390ca03bfb 100644
--- a/ext/standard/php_incomplete_class.h
+++ b/ext/standard/php_incomplete_class.h
@@ -44,12 +44,13 @@
size_t name_len; \
zend_bool free_class_name = 0 \
-
+#define INCOMPLETE_CLASS "__PHP_Incomplete_Class"
+#define MAGIC_MEMBER "__PHP_Incomplete_Class_Name"
#ifdef __cplusplus
extern "C" {
#endif
-
+
zend_class_entry *php_create_incomplete_class(TSRMLS_D);
char *php_lookup_class_name(zval *object, size_t *nlen, zend_bool del);
diff --git a/ext/standard/type.c b/ext/standard/type.c
index b6a61c3173..f42c46ade9 100644
--- a/ext/standard/type.c
+++ b/ext/standard/type.c
@@ -19,6 +19,7 @@
/* $Id$ */
#include "php.h"
+#include "php_incomplete_class.h"
/* {{{ proto string gettype(mixed var)
Returns the type of the variable */
@@ -200,6 +201,13 @@ static void php_is_type(INTERNAL_FUNCTION_PARAMETERS, int type)
}
if (Z_TYPE_PP(arg) == type) {
+ if (type == IS_OBJECT) {
+ zend_class_entry *ce;
+ ce = Z_OBJCE_PP(arg);
+ if (!strcmp(ce->name, INCOMPLETE_CLASS)) {
+ RETURN_FALSE;
+ }
+ }
RETURN_TRUE;
} else {
RETURN_FALSE;