helly           Mon Aug 11 19:35:01 2008 UTC

  Modified files:              (Branch: PHP_5_3)
    /php-src/ext/reflection     php_reflection.c 
  Log:
  - Cleanup
  
http://cvs.php.net/viewvc.cgi/php-src/ext/reflection/php_reflection.c?r1=1.164.2.33.2.45.2.31&r2=1.164.2.33.2.45.2.32&diff_format=u
Index: php-src/ext/reflection/php_reflection.c
diff -u php-src/ext/reflection/php_reflection.c:1.164.2.33.2.45.2.31 
php-src/ext/reflection/php_reflection.c:1.164.2.33.2.45.2.32
--- php-src/ext/reflection/php_reflection.c:1.164.2.33.2.45.2.31        Mon Aug 
11 13:56:24 2008
+++ php-src/ext/reflection/php_reflection.c     Mon Aug 11 19:35:00 2008
@@ -20,7 +20,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: php_reflection.c,v 1.164.2.33.2.45.2.31 2008/08/11 13:56:24 felipe Exp 
$ */
+/* $Id: php_reflection.c,v 1.164.2.33.2.45.2.32 2008/08/11 19:35:00 helly Exp 
$ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -235,8 +235,8 @@
 {
        if (fptr
                && fptr->type == ZEND_INTERNAL_FUNCTION
-               && (fptr->internal_function.fn_flags & 
ZEND_ACC_CALL_VIA_HANDLER) != 0
-       ) {
+               && (fptr->internal_function.fn_flags & 
ZEND_ACC_CALL_VIA_HANDLER) != 0)
+       {
                efree(fptr->internal_function.function_name);
                efree(fptr);
        }
@@ -363,7 +363,7 @@
        /* The information where a class is declared is only available for user 
classes */
        if (ce->type == ZEND_USER_CLASS) {
                string_printf(str, "%s  @@ %s %d-%d\n", indent, ce->filename,
-                                         ce->line_start, ce->line_end);
+                                               ce->line_start, ce->line_end);
        }
 
        /* Constants */
@@ -442,7 +442,8 @@
 
                        while 
(zend_hash_get_current_data_ex(&ce->function_table, (void **) &mptr, &pos) == 
SUCCESS) {
                                if (mptr->common.fn_flags & ZEND_ACC_STATIC
-                                       && ((mptr->common.fn_flags & 
ZEND_ACC_PRIVATE) == 0 || mptr->common.scope == ce)) {
+                                       && ((mptr->common.fn_flags & 
ZEND_ACC_PRIVATE) == 0 || mptr->common.scope == ce))
+                               {
                                        count_static_funcs++;
                                }
                                zend_hash_move_forward_ex(&ce->function_table, 
&pos);
@@ -459,7 +460,8 @@
 
                        while 
(zend_hash_get_current_data_ex(&ce->function_table, (void **) &mptr, &pos) == 
SUCCESS) {
                                if (mptr->common.fn_flags & ZEND_ACC_STATIC
-                                       && ((mptr->common.fn_flags & 
ZEND_ACC_PRIVATE) == 0 || mptr->common.scope == ce)) {
+                                       && ((mptr->common.fn_flags & 
ZEND_ACC_PRIVATE) == 0 || mptr->common.scope == ce))
+                               {
                                        string_printf(str, "\n");
                                        _function_string(str, mptr, ce, 
sub_indent.string TSRMLS_CC);
                                }
@@ -538,25 +540,26 @@
                        
zend_hash_internal_pointer_reset_ex(&ce->function_table, &pos);
 
                        while 
(zend_hash_get_current_data_ex(&ce->function_table, (void **) &mptr, &pos) == 
SUCCESS) {
-                               if ((mptr->common.fn_flags & ZEND_ACC_STATIC) 
== 0 &&
-                                       ((mptr->common.fn_flags & 
ZEND_ACC_PRIVATE) == 0 || mptr->common.scope == ce)) {
+                               if ((mptr->common.fn_flags & ZEND_ACC_STATIC) 
== 0
+                                       && ((mptr->common.fn_flags & 
ZEND_ACC_PRIVATE) == 0 || mptr->common.scope == ce))
+                               {
                                        char *key;
                                        uint key_len;
                                        ulong num_index;
                                        uint len = 
strlen(mptr->common.function_name);
 
                                        /* Do not display old-style inherited 
constructors */
-                                       if ((mptr->common.fn_flags & 
ZEND_ACC_CTOR) == 0 ||
-                                           mptr->common.scope == ce ||
-                                           
zend_hash_get_current_key_ex(&ce->function_table, &key, &key_len, &num_index, 
0, &pos) != HASH_KEY_IS_STRING ||
-                                           zend_binary_strcasecmp(key, 
key_len-1, mptr->common.function_name, len) == 0) {
-
+                                       if ((mptr->common.fn_flags & 
ZEND_ACC_CTOR) == 0
+                                               || mptr->common.scope == ce
+                                               || 
zend_hash_get_current_key_ex(&ce->function_table, &key, &key_len, &num_index, 
0, &pos) != HASH_KEY_IS_STRING
+                                               || zend_binary_strcasecmp(key, 
key_len-1, mptr->common.function_name, len) == 0)
+                                       {
                                                zend_function *closure;
                                                /* see if this is a closure */
-                                               if (ce == zend_ce_closure && 
obj && (len == sizeof(ZEND_INVOKE_FUNC_NAME)-1) &&
-                                                       
memcmp(mptr->common.function_name, ZEND_INVOKE_FUNC_NAME, 
sizeof(ZEND_INVOKE_FUNC_NAME)-1) == 0 &&
-                                                       (closure = 
zend_get_closure_invoke_method(obj TSRMLS_CC)) != NULL
-                                               ) {
+                                               if (ce == zend_ce_closure && 
obj && (len == sizeof(ZEND_INVOKE_FUNC_NAME)-1)
+                                                       && 
memcmp(mptr->common.function_name, ZEND_INVOKE_FUNC_NAME, 
sizeof(ZEND_INVOKE_FUNC_NAME)-1) == 0
+                                                       && (closure = 
zend_get_closure_invoke_method(obj TSRMLS_CC)) != NULL)
+                                               {
                                                        mptr = closure;
                                                } else {
                                                        closure = NULL;
@@ -601,10 +604,7 @@
        }
 
        string_printf(str, "%s    Constant [ %s %s ] { %s }\n",
-                          indent,
-                          type,
-                          name,
-                          Z_STRVAL_P(value));
+                                       indent, type, name, Z_STRVAL_P(value));
 
        if (use_copy) {
                zval_dtor(value);
@@ -620,11 +620,12 @@
 
        ++offset;
        while (op < end) {
-               if ((op->opcode == ZEND_RECV || op->opcode == ZEND_RECV_INIT) &&
-                   op->op1.u.constant.value.lval == (long)offset) {
-                 return op;
-         }
-         ++op;
+               if ((op->opcode == ZEND_RECV || op->opcode == ZEND_RECV_INIT)
+                       && op->op1.u.constant.value.lval == (long)offset)
+               {
+                       return op;
+               }
+               ++op;
        }
        return NULL;
 }
@@ -793,8 +794,8 @@
                                string_printf(str, "protected ");
                                break;
                        default:
-                           string_printf(str, "<visibility error> ");
-                           break;
+                               string_printf(str, "<visibility error> ");
+                               break;
                }
                string_printf(str, "method ");
        } else {
@@ -808,9 +809,9 @@
        /* The information where a function is declared is only available for 
user classes */
        if (fptr->type == ZEND_USER_FUNCTION) {
                string_printf(str, "%s  @@ %s %d - %d\n", indent, 
-                                                                               
                  fptr->op_array.filename,
-                                                                               
                  fptr->op_array.line_start,
-                                                                               
                  fptr->op_array.line_end);
+                                               fptr->op_array.filename,
+                                               fptr->op_array.line_start,
+                                               fptr->op_array.line_end);
        }
        string_init(&param_indent);
        string_printf(&param_indent, "%s  ", indent);
@@ -885,7 +886,7 @@
                                string_printf(str, "%sSYSTEM", comma);
                        }
                }
- 
+
                string_printf(str, "> ]\n");
                string_printf(str, "    %s  Current = '%s'\n", indent, 
ini_entry->value ? ini_entry->value : "");
                if (ini_entry->modified) {
@@ -936,8 +937,8 @@
                string_printf(str, "<temporary>" );
        }
        string_printf(str, " extension #%d %s version %s ] {\n",
-                                 module->module_number, module->name,
-                                 (module->version == NO_VERSION_YET) ? 
"<no_version>" : module->version);
+                                       module->module_number, module->name,
+                                       (module->version == NO_VERSION_YET) ? 
"<no_version>" : module->version);
 
        if (module->deps) {
                const zend_module_dep* dep = module->deps;
@@ -1778,13 +1779,13 @@
 
        array_init(return_value);
        for (i = 0; i < fptr->common.num_args; i++) {
-                zval *parameter;   
+               zval *parameter;   
 
-                ALLOC_ZVAL(parameter);
-                reflection_parameter_factory(fptr, arg_info, i, 
fptr->common.required_num_args, parameter TSRMLS_CC);
-                add_next_index_zval(return_value, parameter);
-                
-                arg_info++;
+               ALLOC_ZVAL(parameter);
+               reflection_parameter_factory(fptr, arg_info, i, 
fptr->common.required_num_args, parameter TSRMLS_CC);
+               add_next_index_zval(return_value, parameter);
+
+               arg_info++;
        }
 }
 /* }}} */
@@ -1896,7 +1897,8 @@
                                char *lcname;
                                
                                if 
((zend_hash_index_find(Z_ARRVAL_P(reference), 0, (void **) &classref) == 
FAILURE)
-                                       || 
(zend_hash_index_find(Z_ARRVAL_P(reference), 1, (void **) &method) == FAILURE)) 
{
+                                       || 
(zend_hash_index_find(Z_ARRVAL_P(reference), 1, (void **) &method) == FAILURE))
+                               {
                                        _DO_THROW("Expected array($object, 
$method) or array($classname, $method)");
                                        /* returns out of this function */
                                }
@@ -1916,11 +1918,11 @@
                                convert_to_string_ex(method);
                                lcname_len = Z_STRLEN_PP(method);
                                lcname = 
zend_str_tolower_dup(Z_STRVAL_PP(method), lcname_len);
-                               if (ce == zend_ce_closure && 
Z_TYPE_PP(classref) == IS_OBJECT &&
-                                       (lcname_len == 
sizeof(ZEND_INVOKE_FUNC_NAME)-1) &&
-                                       memcmp(lcname, ZEND_INVOKE_FUNC_NAME, 
sizeof(ZEND_INVOKE_FUNC_NAME)-1) == 0 &&
-                                       (fptr = 
zend_get_closure_invoke_method(*classref TSRMLS_CC)) != NULL
-                               ) {
+                               if (ce == zend_ce_closure && 
Z_TYPE_PP(classref) == IS_OBJECT
+                                       && (lcname_len == 
sizeof(ZEND_INVOKE_FUNC_NAME)-1)
+                                       && memcmp(lcname, 
ZEND_INVOKE_FUNC_NAME, sizeof(ZEND_INVOKE_FUNC_NAME)-1) == 0
+                                       && (fptr = 
zend_get_closure_invoke_method(*classref TSRMLS_CC)) != NULL)
+                               {
                                        /* nothign to do */
                                } else if (zend_hash_find(&ce->function_table, 
lcname, lcname_len + 1, (void **) &fptr) == FAILURE) {
                                        efree(lcname);
@@ -2081,22 +2083,22 @@
                if (0 == strncmp(param->arg_info->class_name, "self", 
sizeof("self")- 1)) {
                        ce = param->fptr->common.scope;
                        if (!ce) {
-                          zend_throw_exception_ex(reflection_exception_ptr, 0 
TSRMLS_CC, 
-                                  "Parameter uses 'self' as type hint but 
function is not a class member!");
-                          return;
+                               
zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, 
+                                       "Parameter uses 'self' as type hint but 
function is not a class member!");
+                               return;
                        }
                        pce= &ce;
                } else if (0 == strncmp(param->arg_info->class_name, "parent", 
sizeof("parent")- 1)) {
                        ce = param->fptr->common.scope;
                        if (!ce) {
-                          zend_throw_exception_ex(reflection_exception_ptr, 0 
TSRMLS_CC, 
-                                  "Parameter uses 'parent' as type hint but 
function is not a class member!");
-                          return;
+                               
zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, 
+                                       "Parameter uses 'parent' as type hint 
but function is not a class member!");
+                               return;
                        }
                        if (!ce->parent) {
-                          zend_throw_exception_ex(reflection_exception_ptr, 0 
TSRMLS_CC, 
-                                  "Parameter uses 'parent' as type hint 
although class does not have a parent!");
-                          return;
+                               
zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, 
+                                       "Parameter uses 'parent' as type hint 
although class does not have a parent!");
+                               return;
                        }
                        pce= &ce->parent;
                } else if (zend_lookup_class(param->arg_info->class_name, 
param->arg_info->class_name_len, &pce TSRMLS_CC) == FAILURE) {
@@ -2330,10 +2332,10 @@
        
        lcname = zend_str_tolower_dup(name_str, name_len);
 
-       if (ce == zend_ce_closure && orig_obj && (name_len == 
sizeof(ZEND_INVOKE_FUNC_NAME)-1) &&
-               memcmp(lcname, ZEND_INVOKE_FUNC_NAME, 
sizeof(ZEND_INVOKE_FUNC_NAME)-1) == 0 &&
-               (mptr = zend_get_closure_invoke_method(orig_obj TSRMLS_CC)) != 
NULL
-       ) {
+       if (ce == zend_ce_closure && orig_obj && (name_len == 
sizeof(ZEND_INVOKE_FUNC_NAME)-1)
+               && memcmp(lcname, ZEND_INVOKE_FUNC_NAME, 
sizeof(ZEND_INVOKE_FUNC_NAME)-1) == 0
+               && (mptr = zend_get_closure_invoke_method(orig_obj TSRMLS_CC)) 
!= NULL)
+       {
                /* do nothing, mptr already set */
        } else if (zend_hash_find(&ce->function_table, lcname, name_len + 1, 
(void **) &mptr) == FAILURE) {
                efree(lcname);
@@ -2414,8 +2416,9 @@
 
        GET_REFLECTION_OBJECT_PTR(mptr);
 
-       if (!(mptr->common.fn_flags & ZEND_ACC_PUBLIC) ||
-               (mptr->common.fn_flags & ZEND_ACC_ABSTRACT)) {
+       if (!(mptr->common.fn_flags & ZEND_ACC_PUBLIC)
+               || (mptr->common.fn_flags & ZEND_ACC_ABSTRACT))
+       {
                if (mptr->common.fn_flags & ZEND_ACC_ABSTRACT) {
                        zend_throw_exception_ex(reflection_exception_ptr, 0 
TSRMLS_CC, 
                                "Trying to invoke abstract method %s::%s()", 
@@ -2521,8 +2524,9 @@
                return;
        }
 
-       if (!(mptr->common.fn_flags & ZEND_ACC_PUBLIC) ||
-               (mptr->common.fn_flags & ZEND_ACC_ABSTRACT)) {
+       if (!(mptr->common.fn_flags & ZEND_ACC_PUBLIC)
+               || (mptr->common.fn_flags & ZEND_ACC_ABSTRACT))
+       {
                if (mptr->common.fn_flags & ZEND_ACC_ABSTRACT) {
                        zend_throw_exception_ex(reflection_exception_ptr, 0 
TSRMLS_CC, 
                                "Trying to invoke abstract method %s::%s", 
@@ -2669,9 +2673,10 @@
        if (zend_hash_find(Z_OBJPROP_P(getThis()), "name", sizeof("name"), 
(void **) &name) == FAILURE) {
                RETURN_FALSE;
        }
-       if (Z_TYPE_PP(name) == IS_STRING &&
-           (colon = zend_memrchr(Z_STRVAL_PP(name), ':', Z_STRLEN_PP(name))) &&
-           colon > Z_STRVAL_PP(name) && *(colon-1) == ':') {
+       if (Z_TYPE_PP(name) == IS_STRING
+               && (colon = zend_memrchr(Z_STRVAL_PP(name), ':', 
Z_STRLEN_PP(name)))
+               && colon > Z_STRVAL_PP(name) && *(colon-1) == ':')
+       {
                RETURN_TRUE;
        }
        RETURN_FALSE;
@@ -2689,9 +2694,10 @@
        if (zend_hash_find(Z_OBJPROP_P(getThis()), "name", sizeof("name"), 
(void **) &name) == FAILURE) {
                RETURN_FALSE;
        }
-       if (Z_TYPE_PP(name) == IS_STRING &&
-           (colon = zend_memrchr(Z_STRVAL_PP(name), ':', Z_STRLEN_PP(name))) &&
-           colon > Z_STRVAL_PP(name) && *(colon-1) == ':') {
+       if (Z_TYPE_PP(name) == IS_STRING
+               && (colon = zend_memrchr(Z_STRVAL_PP(name), ':', 
Z_STRLEN_PP(name)))
+               && colon > Z_STRVAL_PP(name) && *(colon-1) == ':')
+       {
                RETURN_STRINGL(Z_STRVAL_PP(name), colon - Z_STRVAL_PP(name) - 
1, 1);
        }
        RETURN_EMPTY_STRING();
@@ -2709,9 +2715,10 @@
        if (zend_hash_find(Z_OBJPROP_P(getThis()), "name", sizeof("name"), 
(void **) &name) == FAILURE) {
                RETURN_FALSE;
        }
-       if (Z_TYPE_PP(name) == IS_STRING &&
-           (colon = zend_memrchr(Z_STRVAL_PP(name), ':', Z_STRLEN_PP(name))) &&
-           colon > Z_STRVAL_PP(name) && *(colon-1) == ':') {
+       if (Z_TYPE_PP(name) == IS_STRING
+               && (colon = zend_memrchr(Z_STRVAL_PP(name), ':', 
Z_STRLEN_PP(name)))
+               && colon > Z_STRVAL_PP(name) && *(colon-1) == ':')
+       {
                RETURN_STRINGL(colon + 1, Z_STRLEN_PP(name) - (colon - 
Z_STRVAL_PP(name) + 1), 1);
        }
        RETURN_ZVAL(*name, 1, 0);
@@ -3199,10 +3206,10 @@
 
        GET_REFLECTION_OBJECT_PTR(ce);
        lc_name = zend_str_tolower_dup(name, name_len);
-       if (ce == zend_ce_closure && intern->obj && (name_len == 
sizeof(ZEND_INVOKE_FUNC_NAME)-1) &&
-               memcmp(lc_name, ZEND_INVOKE_FUNC_NAME, 
sizeof(ZEND_INVOKE_FUNC_NAME)-1) == 0 &&
-               (mptr = zend_get_closure_invoke_method(intern->obj TSRMLS_CC)) 
!= NULL
-       ) {
+       if (ce == zend_ce_closure && intern->obj && (name_len == 
sizeof(ZEND_INVOKE_FUNC_NAME)-1)
+               && memcmp(lc_name, ZEND_INVOKE_FUNC_NAME, 
sizeof(ZEND_INVOKE_FUNC_NAME)-1) == 0
+               && (mptr = zend_get_closure_invoke_method(intern->obj 
TSRMLS_CC)) != NULL)
+       {
                reflection_method_factory(ce, mptr, return_value TSRMLS_CC);
                efree(lc_name);
        } else if (zend_hash_find(&ce->function_table, lc_name, name_len + 1, 
(void**) &mptr) == SUCCESS) {
@@ -3226,10 +3233,10 @@
 
        if (mptr->common.fn_flags & filter) {
                ALLOC_ZVAL(method);
-               if (ce == zend_ce_closure && obj && (len == 
sizeof(ZEND_INVOKE_FUNC_NAME)-1) &&
-                       memcmp(mptr->common.function_name, 
ZEND_INVOKE_FUNC_NAME, sizeof(ZEND_INVOKE_FUNC_NAME)-1) == 0 &&
-                       (closure = zend_get_closure_invoke_method(obj 
TSRMLS_CC)) != NULL
-               ) {
+               if (ce == zend_ce_closure && obj && (len == 
sizeof(ZEND_INVOKE_FUNC_NAME)-1)
+                       && memcmp(mptr->common.function_name, 
ZEND_INVOKE_FUNC_NAME, sizeof(ZEND_INVOKE_FUNC_NAME)-1) == 0
+                       && (closure = zend_get_closure_invoke_method(obj 
TSRMLS_CC)) != NULL)
+               {
                        mptr = closure;
                }
                reflection_method_factory(ce, mptr, method TSRMLS_CC);
@@ -3766,7 +3773,7 @@
        if (ce->num_interfaces) {
                zend_uint i;
 
-               for (i=0; i < ce->num_interfaces; i++) {
+               for (i=0; i < ce->num_interfaces; i++) {
                        zval *interface;
                        ALLOC_ZVAL(interface);
                        zend_reflection_class_factory(ce->interfaces[i], 
interface TSRMLS_CC);
@@ -3790,7 +3797,7 @@
        /* Return an empty array if this class implements no interfaces */
        array_init(return_value);
 
-       for (i=0; i < ce->num_interfaces; i++) {
+       for (i=0; i < ce->num_interfaces; i++) {
                add_next_index_stringl(return_value, ce->interfaces[i]->name, 
ce->interfaces[i]->name_length, 1);
        }
 }
@@ -3968,11 +3975,12 @@
        if (zend_hash_find(Z_OBJPROP_P(getThis()), "name", sizeof("name"), 
(void **) &name) == FAILURE) {
                RETURN_FALSE;
        }
-       if (Z_TYPE_PP(name) == IS_STRING &&
-           (colon = zend_memrchr(Z_STRVAL_PP(name), ':', Z_STRLEN_PP(name))) &&
-           colon > Z_STRVAL_PP(name) && *(colon-1) == ':') {
+       if (Z_TYPE_PP(name) == IS_STRING
+               && (colon = zend_memrchr(Z_STRVAL_PP(name), ':', 
Z_STRLEN_PP(name)))
+               && colon > Z_STRVAL_PP(name) && *(colon-1) == ':')
+       {
                RETURN_TRUE;
-    }
+       }
        RETURN_FALSE;
 }
 /* }}} */
@@ -3988,11 +3996,12 @@
        if (zend_hash_find(Z_OBJPROP_P(getThis()), "name", sizeof("name"), 
(void **) &name) == FAILURE) {
                RETURN_FALSE;
        }
-       if (Z_TYPE_PP(name) == IS_STRING &&
-           (colon = zend_memrchr(Z_STRVAL_PP(name), ':', Z_STRLEN_PP(name))) &&
-           colon > Z_STRVAL_PP(name) && *(colon-1) == ':') {
+       if (Z_TYPE_PP(name) == IS_STRING
+               && (colon = zend_memrchr(Z_STRVAL_PP(name), ':', 
Z_STRLEN_PP(name)))
+               && colon > Z_STRVAL_PP(name) && *(colon-1) == ':')
+       {
                RETURN_STRINGL(Z_STRVAL_PP(name), colon - Z_STRVAL_PP(name) - 
1, 1);
-    }
+       }
        RETURN_EMPTY_STRING();
 }
 /* }}} */
@@ -4008,12 +4017,13 @@
        if (zend_hash_find(Z_OBJPROP_P(getThis()), "name", sizeof("name"), 
(void **) &name) == FAILURE) {
                RETURN_FALSE;
        }
-       if (Z_TYPE_PP(name) == IS_STRING &&
-           (colon = zend_memrchr(Z_STRVAL_PP(name), ':', Z_STRLEN_PP(name))) &&
-           colon > Z_STRVAL_PP(name) && *(colon-1) == ':') {
+       if (Z_TYPE_PP(name) == IS_STRING
+               && (colon = zend_memrchr(Z_STRVAL_PP(name), ':', 
Z_STRLEN_PP(name)))
+               && colon > Z_STRVAL_PP(name) && *(colon-1) == ':')
+       {
                RETURN_STRINGL(colon + 1, Z_STRLEN_PP(name) - (colon - 
Z_STRVAL_PP(name) + 1), 1);
-    }
-    RETURN_ZVAL(*name, 1, 0);
+       }
+       RETURN_ZVAL(*name, 1, 0);
 }
 /* }}} */
 
@@ -5103,9 +5113,9 @@
 static void _reflection_write_property(zval *object, zval *member, zval *value 
TSRMLS_DC)
 {
        if ((Z_TYPE_P(member) == IS_STRING)
-       && zend_hash_exists(&Z_OBJCE_P(object)->default_properties, 
Z_STRVAL_P(member), Z_STRLEN_P(member)+1)
-       && ((Z_STRLEN_P(member) == sizeof("name") - 1  && 
!memcmp(Z_STRVAL_P(member), "name",  sizeof("name"))) ||
-           (Z_STRLEN_P(member) == sizeof("class") - 1 && 
!memcmp(Z_STRVAL_P(member), "class", sizeof("class")))))
+               && zend_hash_exists(&Z_OBJCE_P(object)->default_properties, 
Z_STRVAL_P(member), Z_STRLEN_P(member)+1)
+               && ((Z_STRLEN_P(member) == sizeof("name") - 1  && 
!memcmp(Z_STRVAL_P(member), "name",  sizeof("name")))
+                       || (Z_STRLEN_P(member) == sizeof("class") - 1 && 
!memcmp(Z_STRVAL_P(member), "class", sizeof("class")))))
        {
                zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, 
                        "Cannot set read-only property %s::$%s", 
Z_OBJCE_P(object)->name, Z_STRVAL_P(member));
@@ -5140,7 +5150,7 @@
        reflection_function_abstract_ptr = 
zend_register_internal_class(&_reflection_entry TSRMLS_CC);
        reflection_register_implement(reflection_function_abstract_ptr, 
reflector_ptr TSRMLS_CC);
        zend_declare_property_string(reflection_function_abstract_ptr, "name", 
sizeof("name")-1, "", ZEND_ACC_ABSTRACT TSRMLS_CC);
-    
+
        INIT_CLASS_ENTRY(_reflection_entry, "ReflectionFunction", 
reflection_function_functions);
        _reflection_entry.create_object = reflection_objects_new;
        reflection_function_ptr = 
zend_register_internal_class_ex(&_reflection_entry, 
reflection_function_abstract_ptr, NULL TSRMLS_CC);
@@ -5207,7 +5217,7 @@
        php_info_print_table_start();
        php_info_print_table_header(2, "Reflection", "enabled");
 
-       php_info_print_table_row(2, "Version", "$Id: php_reflection.c,v 
1.164.2.33.2.45.2.31 2008/08/11 13:56:24 felipe Exp $");
+       php_info_print_table_row(2, "Version", "$Id: php_reflection.c,v 
1.164.2.33.2.45.2.32 2008/08/11 19:35:00 helly Exp $");
 
        php_info_print_table_end();
 } /* }}} */

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to