"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;
efree(class_name);
- php_error(E_ERROR, "%s", buf);
+ php_error(error_type, "%s", buf);
}
/* }}} */
*/
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);
}
/* }}} */
*/
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);
{
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 */
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);
/* $Id$ */
#include "php.h"
+#include "php_incomplete_class.h"
/* {{{ proto string gettype(mixed var)
Returns the type of the variable */
}
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;