From: Andi Gutmans Date: Tue, 5 Nov 2002 18:16:11 +0000 (+0000) Subject: - Change the automatically created variable $clone in __clone() to X-Git-Tag: php-4.3.0RC1~255 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f7f9721bdb4205baff07dcb3d670e12af9e03f0f;p=php - Change the automatically created variable $clone in __clone() to - $that as discussed at the PHP Conference. If there are any objections - alternative names please let me know. The reason for changing it from - $clone is because $clone sounds as if it's the newly cloned object and - not the old one. --- diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index 3dcb506c16..9d820d39dc 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -2236,8 +2236,8 @@ void zend_do_fetch_property(znode *result, znode *object, znode *property TSRMLS if (CG(in_clone_method)) { if ((opline_ptr->op1.op_type == IS_CONST) && (opline_ptr->op1.u.constant.type == IS_STRING) && - (opline_ptr->op1.u.constant.value.str.len == (sizeof("clone")-1)) && - !memcmp(opline_ptr->op1.u.constant.value.str.val, "clone", sizeof("clone"))) { + (opline_ptr->op1.u.constant.value.str.len == (sizeof("that")-1)) && + !memcmp(opline_ptr->op1.u.constant.value.str.val, "that", sizeof("that"))) { if (CG(active_class_entry) && (opline.op2.op_type == IS_CONST)) { if (zend_hash_exists(&CG(active_class_entry)->private_properties, opline.op2.u.constant.value.str.val, opline.op2.u.constant.value.str.len+1)) { char *priv_name; diff --git a/Zend/zend_objects.c b/Zend/zend_objects.c index a6b7579350..ec9f11d27b 100644 --- a/Zend/zend_objects.c +++ b/Zend/zend_objects.c @@ -106,7 +106,7 @@ ZEND_API zend_object_value zend_objects_clone_obj(zval *zobject TSRMLS_DC) zend_hash_init(new_object->properties, 0, NULL, ZVAL_PTR_DTOR, 0); ZEND_INIT_SYMTABLE(&symbol_table); - ZEND_SET_SYMBOL(&symbol_table, "clone", old_obj); + ZEND_SET_SYMBOL(&symbol_table, "that", old_obj); call_user_function_ex(NULL, &new_obj, clone_func_name, &retval_ptr, 0, NULL, 0, &symbol_table TSRMLS_CC);