cvs: ZendEngine2 / zend_compile.c zend_compile.h zend_execute.c zend_object_handlers.c zend_object_handlers.h
| From: | Zeev Suraski | Date: | Mon, 07 Jul 2003 09:00:36 +0000 |
| Subject: | cvs: ZendEngine2 / zend_compile.c zend_compile.h zend_execute.c zend_object_handlers.c zend_object_handlers.h | ||
| Groups: | php.zend-engine.cvs | ||
| Request: | Send a blank email to php-zend-engine-cvs+get-1462@lists.php.net to get a copy of this message | ||
zeev Mon Jul 7 05:00:36 2003 EDT
Modified files:
/ZendEngine2 zend_compile.c zend_compile.h zend_execute.c
zend_object_handlers.c zend_object_handlers.h
Log:
Initial support for overloading of array syntax for objects (very initial)
Index: ZendEngine2/zend_compile.c diff -u ZendEngine2/zend_compile.c:1.434 ZendEngine2/zend_compile.c:1.435 --- ZendEngine2/zend_compile.c:1.434 Thu Jul 3 12:45:35 2003 +++ ZendEngine2/zend_compile.c Mon Jul 7 05:00:35 2003 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_compile.c,v 1.434 2003/07/03 16:45:35 helly Exp $ */ +/* $Id: zend_compile.c,v 1.435 2003/07/07 09:00:35 zeev Exp $ */ #include "zend_language_parser.h" #include "zend.h" @@ -445,6 +445,15 @@ last_op->opcode = ZEND_ASSIGN_OBJ; zend_do_op_data(opline, value TSRMLS_CC); + SET_UNUSED(opline->result); + *result = last_op->result; + } else if (last_op->opcode == ZEND_FETCH_DIM_W) { + last_op->opcode = ZEND_ASSIGN_DIM; + + zend_do_op_data(opline, value TSRMLS_CC); + opline->op2.u.var = get_temporary_variable(CG(active_op_array)); + opline->op2.u.EA.type = 0; + opline->op2.op_type = IS_VAR; SET_UNUSED(opline->result); *result = last_op->result; } else { Index: ZendEngine2/zend_compile.h diff -u ZendEngine2/zend_compile.h:1.244 ZendEngine2/zend_compile.h:1.245 --- ZendEngine2/zend_compile.h:1.244 Sat Jun 21 17:56:06 2003 +++ ZendEngine2/zend_compile.h Mon Jul 7 05:00:35 2003 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_compile.h,v 1.244 2003/06/21 21:56:06 helly Exp $ */ +/* $Id: zend_compile.h,v 1.245 2003/07/07 09:00:35 zeev Exp $ */ #ifndef ZEND_COMPILE_H #define ZEND_COMPILE_H @@ -675,6 +675,8 @@ #define ZEND_ADD_INTERFACE 144 #define ZEND_VERIFY_INSTANCEOF 145 #define ZEND_VERIFY_ABSTRACT_CLASS 146 + +#define ZEND_ASSIGN_DIM 147 /* end of block */ /* END: OPCODES */ Index: ZendEngine2/zend_execute.c diff -u ZendEngine2/zend_execute.c:1.486 ZendEngine2/zend_execute.c:1.487 --- ZendEngine2/zend_execute.c:1.486 Thu Jul 3 08:03:11 2003 +++ ZendEngine2/zend_execute.c Mon Jul 7 05:00:36 2003 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_execute.c,v 1.486 2003/07/03 12:03:11 stas Exp $ */ +/* $Id: zend_execute.c,v 1.487 2003/07/07 09:00:36 zeev Exp $ */ #define ZEND_INTENSIVE_DEBUGGING 0 @@ -281,9 +281,8 @@ return get_zval_ptr(op, Ts, freeop, type); } -static inline void zend_assign_to_object(znode *result, znode *op1, znode *op2, znode *value_op, temp_variable *Ts TSRMLS_DC) +static inline void zend_assign_to_object(znode *result, zval **object_ptr, znode *op2, znode *value_op, temp_variable *Ts, int opcode TSRMLS_DC) { - zval **object_ptr = get_obj_zval_ptr_ptr(op1, Ts, BP_VAR_W TSRMLS_CC); zval *object; zval *property = get_zval_ptr(op2, Ts, &EG(free_op2), BP_VAR_R); zval *free_value; @@ -336,7 +335,11 @@ value->is_ref = 0; value->refcount = 0; } - Z_OBJ_HT_P(object)->write_property(object, property, value TSRMLS_CC); + if (opcode == ZEND_ASSIGN_OBJ) { + Z_OBJ_HT_P(object)->write_property(object, property, value TSRMLS_CC); + } else { + Z_OBJ_HT_P(object)->write_dimension(object, property, value TSRMLS_CC); + } if (property == &tmp) { zval_dtor(property); } @@ -2006,13 +2009,39 @@ int zend_assign_obj_handler(ZEND_OPCODE_HANDLER_ARGS) { zend_op *op_data = EX(opline)+1; - zend_assign_to_object(&EX(opline)->result, &EX(opline)->op1, &EX(opline)->op2, &op_data->op1, EX(Ts) TSRMLS_CC); + zval **object_ptr = get_obj_zval_ptr_ptr(&EX(opline)->op1, EX(Ts), BP_VAR_W TSRMLS_CC); + + zend_assign_to_object(&EX(opline)->result, object_ptr, &EX(opline)->op2, &op_data->op1, EX(Ts), ZEND_ASSIGN_OBJ TSRMLS_CC); /* assign_obj has two opcodes! */ EX(opline)++; NEXT_OPCODE(); } +int zend_assign_dim_handler(ZEND_OPCODE_HANDLER_ARGS) + { + zend_op *op_data = EX(opline)+1; + zval **object_ptr = get_obj_zval_ptr_ptr(&EX(opline)->op1, EX(Ts), BP_VAR_W TSRMLS_CC); + + if ((*object_ptr)->type == IS_OBJECT) { + zend_assign_to_object(&EX(opline)->result, object_ptr, &EX(opline)->op2, &op_data->op1, EX(Ts), ZEND_ASSIGN_DIM TSRMLS_CC); + /* assign_dim has two opcodes! */ + } else { + zval *value; + zend_op *data_opline = EX(opline)+1; + + (*object_ptr)->refcount++; /* undo the effect of get_obj_zval_ptr_ptr() */ + zend_fetch_dimension_address(&data_opline->op2, &EX(opline)->op1, &EX(opline)->op2, EX(Ts), BP_VAR_W TSRMLS_CC); + + /* opline points to the data op at this point */ + value = get_zval_ptr(&data_opline->op1, EX(Ts), &EG(free_op1), BP_VAR_R); + zend_assign_to_variable(&EX(opline)->result, &data_opline->op2, &EX(opline)->op2, value, (EG(free_op1)?IS_TMP_VAR:EX(opline)->op1.op_type), EX(Ts) TSRMLS_CC); + } + EX(opline)++; + NEXT_OPCODE(); +} + + int zend_assign_handler(ZEND_OPCODE_HANDLER_ARGS) { zval *value; @@ -4234,6 +4263,8 @@ zend_opcode_handlers[ZEND_ADD_INTERFACE] = zend_add_interface_handler; zend_opcode_handlers[ZEND_VERIFY_INSTANCEOF] = zend_verify_instanceof_handler; zend_opcode_handlers[ZEND_VERIFY_ABSTRACT_CLASS] = zend_verify_abstract_class; + + zend_opcode_handlers[ZEND_ASSIGN_DIM] = zend_assign_dim_handler; } /* Index: ZendEngine2/zend_object_handlers.c diff -u ZendEngine2/zend_object_handlers.c:1.55 ZendEngine2/zend_object_handlers.c:1.56 --- ZendEngine2/zend_object_handlers.c:1.55 Tue Jul 1 15:13:50 2003 +++ ZendEngine2/zend_object_handlers.c Mon Jul 7 05:00:36 2003 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_object_handlers.c,v 1.55 2003/07/01 19:13:50 helly Exp $ */ +/* $Id: zend_object_handlers.c,v 1.56 2003/07/07 09:00:36 zeev Exp $ */ #include "zend.h" #include "zend_globals.h" @@ -335,6 +335,25 @@ } } + +static void zend_std_write_dimension(zval *object, zval *offset, zval *value TSRMLS_DC) +{ + zend_error("Cannot use object as array"); +#if 0 + zend_printf("Assigning to object: "); + zend_print_zval(object, 0); + + zend_printf("\n with offset: "); + zend_print_zval(offset, 0); + + zend_printf("\n the value: "); + zend_print_zval(value, 0); +#endif + + zend_printf("\n"); +} + + static zval **zend_std_get_property_ptr(zval *object, zval *member TSRMLS_DC) { zend_object *zobj; @@ -816,6 +835,7 @@ zend_std_read_property, /* read_property */ zend_std_write_property, /* write_property */ + zend_std_write_dimension, /* write_dimension */ zend_std_get_property_ptr, /* get_property_ptr */ zend_std_get_property_ptr, /* get_property_zval_ptr */ NULL, /* get */ Index: ZendEngine2/zend_object_handlers.h diff -u ZendEngine2/zend_object_handlers.h:1.17 ZendEngine2/zend_object_handlers.h:1.18 --- ZendEngine2/zend_object_handlers.h:1.17 Tue Jul 1 15:13:50 2003 +++ ZendEngine2/zend_object_handlers.h Mon Jul 7 05:00:36 2003 @@ -17,46 +17,55 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_object_handlers.h,v 1.17 2003/07/01 19:13:50 helly Exp $ */ +/* $Id: zend_object_handlers.h,v 1.18 2003/07/07 09:00:36 zeev Exp $ */ #ifndef ZEND_OBJECT_HANDLERS_H #define ZEND_OBJECT_HANDLERS_H union _zend_function; -typedef zval *(*zend_object_read_property_t)(zval *object, zval *member TSRMLS_DC); /* Used to fetch property from the object, read-only */ -typedef void (*zend_object_write_property_t)(zval *object, zval *member, zval *value TSRMLS_DC); +typedef zval *(*zend_object_read_property_t)(zval *object, zval *member TSRMLS_DC); + /* Used to set property of the object */ +typedef void (*zend_object_write_property_t)(zval *object, zval *member, zval *value TSRMLS_DC); + +/* Used to set dimension of the object */ +typedef void (*zend_object_write_dimension_t)(zval *object, zval *offset, zval *value TSRMLS_DC); -typedef zval **(*zend_object_get_property_ptr_t)(zval *object, zval *member TSRMLS_DC); /* Used to create pointer to the property of the object, for future r/w access via get/set */ -typedef zval **(*zend_object_get_property_zval_ptr_t)(zval *object, zval *member TSRMLS_DC); +typedef zval **(*zend_object_get_property_ptr_t)(zval *object, zval *member TSRMLS_DC); + /* Used to create pointer to the property of the object, for future direct r/w access */ -typedef void (*zend_object_set_t)(zval **property, zval *value TSRMLS_DC); +typedef zval **(*zend_object_get_property_zval_ptr_t)(zval *object, zval *member TSRMLS_DC); + /* Used to set object value (most probably used in combination with -typedef the result of the get_property_ptr) */ -typedef zval* (*zend_object_get_t)(zval *property TSRMLS_DC); + * typedef the result of the get_property_ptr) + */ +typedef void (*zend_object_set_t)(zval **property, zval *value TSRMLS_DC); + /* Used to get object value (most probably used in combination with -the result of the get_property_ptr or when converting object value to -one of the basic types) */ + * the result of the get_property_ptr or when converting object value to + * one of the basic types) + */ +typedef zval* (*zend_object_get_t)(zval *property TSRMLS_DC); -typedef int (*zend_object_has_property_t)(zval *object, zval *member, int check_empty TSRMLS_DC); /* Used to check if a property of the object exists */ -typedef void (*zend_object_unset_property_t)(zval *object, zval *member TSRMLS_DC); +typedef int (*zend_object_has_property_t)(zval *object, zval *member, int check_empty TSRMLS_DC); + /* Used to remove a property of the object */ +typedef void (*zend_object_unset_property_t)(zval *object, zval *member TSRMLS_DC); -typedef HashTable *(*zend_object_get_properties_t)(zval *object TSRMLS_DC); /* Used to get hash of the properties of the object, as hash of zval's */ +typedef HashTable *(*zend_object_get_properties_t)(zval *object TSRMLS_DC); -typedef int (*zend_object_call_method_t)(char *method, INTERNAL_FUNCTION_PARAMETERS); /* Used to call methods */ /* args on stack! */ -/* Andi - EX(fbc) (function being called) needs to be initialized already in the INIT fcall opcode so that the parameters can be parsed the right way. We need to add another callback fror this. -*/ +/* Andi - EX(fbc) (function being called) needs to be initialized already in the INIT fcall opcode so that the parameters can be parsed the right way. We need to add another callback for this. + */ +typedef int (*zend_object_call_method_t)(char *method, INTERNAL_FUNCTION_PARAMETERS); typedef union _zend_function *(*zend_object_get_method_t)(zval *object, char *method, int method_len TSRMLS_DC); typedef union _zend_function *(*zend_object_get_constructor_t)(zval *object TSRMLS_DC); -/* Get method parameter mask - by value/by reference, etc. */ /* Object maintenance/destruction */ typedef void (*zend_object_add_ref_t)(zval *object TSRMLS_DC); @@ -79,6 +88,7 @@ /* individual object functions */ zend_object_read_property_t read_property; zend_object_write_property_t write_property; + zend_object_write_dimension_t write_dimension; zend_object_get_property_ptr_t get_property_ptr; zend_object_get_property_zval_ptr_t get_property_zval_ptr; zend_object_get_t get;
Index: ZendEngine2/zend_compile.c diff -u ZendEngine2/zend_compile.c:1.434 ZendEngine2/zend_compile.c:1.435 --- ZendEngine2/zend_compile.c:1.434 Thu Jul 3 12:45:35 2003 +++ ZendEngine2/zend_compile.c Mon Jul 7 05:00:35 2003 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_compile.c,v 1.434 2003/07/03 16:45:35 helly Exp $ */ +/* $Id: zend_compile.c,v 1.435 2003/07/07 09:00:35 zeev Exp $ */ #include "zend_language_parser.h" #include "zend.h" @@ -445,6 +445,15 @@ last_op->opcode = ZEND_ASSIGN_OBJ; zend_do_op_data(opline, value TSRMLS_CC); + SET_UNUSED(opline->result); + *result = last_op->result; + } else if (last_op->opcode == ZEND_FETCH_DIM_W) { + last_op->opcode = ZEND_ASSIGN_DIM; + + zend_do_op_data(opline, value TSRMLS_CC); + opline->op2.u.var = get_temporary_variable(CG(active_op_array)); + opline->op2.u.EA.type = 0; + opline->op2.op_type = IS_VAR; SET_UNUSED(opline->result); *result = last_op->result; } else { Index: ZendEngine2/zend_compile.h diff -u ZendEngine2/zend_compile.h:1.244 ZendEngine2/zend_compile.h:1.245 --- ZendEngine2/zend_compile.h:1.244 Sat Jun 21 17:56:06 2003 +++ ZendEngine2/zend_compile.h Mon Jul 7 05:00:35 2003 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_compile.h,v 1.244 2003/06/21 21:56:06 helly Exp $ */ +/* $Id: zend_compile.h,v 1.245 2003/07/07 09:00:35 zeev Exp $ */ #ifndef ZEND_COMPILE_H #define ZEND_COMPILE_H @@ -675,6 +675,8 @@ #define ZEND_ADD_INTERFACE 144 #define ZEND_VERIFY_INSTANCEOF 145 #define ZEND_VERIFY_ABSTRACT_CLASS 146 + +#define ZEND_ASSIGN_DIM 147 /* end of block */ /* END: OPCODES */ Index: ZendEngine2/zend_execute.c diff -u ZendEngine2/zend_execute.c:1.486 ZendEngine2/zend_execute.c:1.487 --- ZendEngine2/zend_execute.c:1.486 Thu Jul 3 08:03:11 2003 +++ ZendEngine2/zend_execute.c Mon Jul 7 05:00:36 2003 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_execute.c,v 1.486 2003/07/03 12:03:11 stas Exp $ */ +/* $Id: zend_execute.c,v 1.487 2003/07/07 09:00:36 zeev Exp $ */ #define ZEND_INTENSIVE_DEBUGGING 0 @@ -281,9 +281,8 @@ return get_zval_ptr(op, Ts, freeop, type); } -static inline void zend_assign_to_object(znode *result, znode *op1, znode *op2, znode *value_op, temp_variable *Ts TSRMLS_DC) +static inline void zend_assign_to_object(znode *result, zval **object_ptr, znode *op2, znode *value_op, temp_variable *Ts, int opcode TSRMLS_DC) { - zval **object_ptr = get_obj_zval_ptr_ptr(op1, Ts, BP_VAR_W TSRMLS_CC); zval *object; zval *property = get_zval_ptr(op2, Ts, &EG(free_op2), BP_VAR_R); zval *free_value; @@ -336,7 +335,11 @@ value->is_ref = 0; value->refcount = 0; } - Z_OBJ_HT_P(object)->write_property(object, property, value TSRMLS_CC); + if (opcode == ZEND_ASSIGN_OBJ) { + Z_OBJ_HT_P(object)->write_property(object, property, value TSRMLS_CC); + } else { + Z_OBJ_HT_P(object)->write_dimension(object, property, value TSRMLS_CC); + } if (property == &tmp) { zval_dtor(property); } @@ -2006,13 +2009,39 @@ int zend_assign_obj_handler(ZEND_OPCODE_HANDLER_ARGS) { zend_op *op_data = EX(opline)+1; - zend_assign_to_object(&EX(opline)->result, &EX(opline)->op1, &EX(opline)->op2, &op_data->op1, EX(Ts) TSRMLS_CC); + zval **object_ptr = get_obj_zval_ptr_ptr(&EX(opline)->op1, EX(Ts), BP_VAR_W TSRMLS_CC); + + zend_assign_to_object(&EX(opline)->result, object_ptr, &EX(opline)->op2, &op_data->op1, EX(Ts), ZEND_ASSIGN_OBJ TSRMLS_CC); /* assign_obj has two opcodes! */ EX(opline)++; NEXT_OPCODE(); } +int zend_assign_dim_handler(ZEND_OPCODE_HANDLER_ARGS) + { + zend_op *op_data = EX(opline)+1; + zval **object_ptr = get_obj_zval_ptr_ptr(&EX(opline)->op1, EX(Ts), BP_VAR_W TSRMLS_CC); + + if ((*object_ptr)->type == IS_OBJECT) { + zend_assign_to_object(&EX(opline)->result, object_ptr, &EX(opline)->op2, &op_data->op1, EX(Ts), ZEND_ASSIGN_DIM TSRMLS_CC); + /* assign_dim has two opcodes! */ + } else { + zval *value; + zend_op *data_opline = EX(opline)+1; + + (*object_ptr)->refcount++; /* undo the effect of get_obj_zval_ptr_ptr() */ + zend_fetch_dimension_address(&data_opline->op2, &EX(opline)->op1, &EX(opline)->op2, EX(Ts), BP_VAR_W TSRMLS_CC); + + /* opline points to the data op at this point */ + value = get_zval_ptr(&data_opline->op1, EX(Ts), &EG(free_op1), BP_VAR_R); + zend_assign_to_variable(&EX(opline)->result, &data_opline->op2, &EX(opline)->op2, value, (EG(free_op1)?IS_TMP_VAR:EX(opline)->op1.op_type), EX(Ts) TSRMLS_CC); + } + EX(opline)++; + NEXT_OPCODE(); +} + + int zend_assign_handler(ZEND_OPCODE_HANDLER_ARGS) { zval *value; @@ -4234,6 +4263,8 @@ zend_opcode_handlers[ZEND_ADD_INTERFACE] = zend_add_interface_handler; zend_opcode_handlers[ZEND_VERIFY_INSTANCEOF] = zend_verify_instanceof_handler; zend_opcode_handlers[ZEND_VERIFY_ABSTRACT_CLASS] = zend_verify_abstract_class; + + zend_opcode_handlers[ZEND_ASSIGN_DIM] = zend_assign_dim_handler; } /* Index: ZendEngine2/zend_object_handlers.c diff -u ZendEngine2/zend_object_handlers.c:1.55 ZendEngine2/zend_object_handlers.c:1.56 --- ZendEngine2/zend_object_handlers.c:1.55 Tue Jul 1 15:13:50 2003 +++ ZendEngine2/zend_object_handlers.c Mon Jul 7 05:00:36 2003 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_object_handlers.c,v 1.55 2003/07/01 19:13:50 helly Exp $ */ +/* $Id: zend_object_handlers.c,v 1.56 2003/07/07 09:00:36 zeev Exp $ */ #include "zend.h" #include "zend_globals.h" @@ -335,6 +335,25 @@ } } + +static void zend_std_write_dimension(zval *object, zval *offset, zval *value TSRMLS_DC) +{ + zend_error("Cannot use object as array"); +#if 0 + zend_printf("Assigning to object: "); + zend_print_zval(object, 0); + + zend_printf("\n with offset: "); + zend_print_zval(offset, 0); + + zend_printf("\n the value: "); + zend_print_zval(value, 0); +#endif + + zend_printf("\n"); +} + + static zval **zend_std_get_property_ptr(zval *object, zval *member TSRMLS_DC) { zend_object *zobj; @@ -816,6 +835,7 @@ zend_std_read_property, /* read_property */ zend_std_write_property, /* write_property */ + zend_std_write_dimension, /* write_dimension */ zend_std_get_property_ptr, /* get_property_ptr */ zend_std_get_property_ptr, /* get_property_zval_ptr */ NULL, /* get */ Index: ZendEngine2/zend_object_handlers.h diff -u ZendEngine2/zend_object_handlers.h:1.17 ZendEngine2/zend_object_handlers.h:1.18 --- ZendEngine2/zend_object_handlers.h:1.17 Tue Jul 1 15:13:50 2003 +++ ZendEngine2/zend_object_handlers.h Mon Jul 7 05:00:36 2003 @@ -17,46 +17,55 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_object_handlers.h,v 1.17 2003/07/01 19:13:50 helly Exp $ */ +/* $Id: zend_object_handlers.h,v 1.18 2003/07/07 09:00:36 zeev Exp $ */ #ifndef ZEND_OBJECT_HANDLERS_H #define ZEND_OBJECT_HANDLERS_H union _zend_function; -typedef zval *(*zend_object_read_property_t)(zval *object, zval *member TSRMLS_DC); /* Used to fetch property from the object, read-only */ -typedef void (*zend_object_write_property_t)(zval *object, zval *member, zval *value TSRMLS_DC); +typedef zval *(*zend_object_read_property_t)(zval *object, zval *member TSRMLS_DC); + /* Used to set property of the object */ +typedef void (*zend_object_write_property_t)(zval *object, zval *member, zval *value TSRMLS_DC); + +/* Used to set dimension of the object */ +typedef void (*zend_object_write_dimension_t)(zval *object, zval *offset, zval *value TSRMLS_DC); -typedef zval **(*zend_object_get_property_ptr_t)(zval *object, zval *member TSRMLS_DC); /* Used to create pointer to the property of the object, for future r/w access via get/set */ -typedef zval **(*zend_object_get_property_zval_ptr_t)(zval *object, zval *member TSRMLS_DC); +typedef zval **(*zend_object_get_property_ptr_t)(zval *object, zval *member TSRMLS_DC); + /* Used to create pointer to the property of the object, for future direct r/w access */ -typedef void (*zend_object_set_t)(zval **property, zval *value TSRMLS_DC); +typedef zval **(*zend_object_get_property_zval_ptr_t)(zval *object, zval *member TSRMLS_DC); + /* Used to set object value (most probably used in combination with -typedef the result of the get_property_ptr) */ -typedef zval* (*zend_object_get_t)(zval *property TSRMLS_DC); + * typedef the result of the get_property_ptr) + */ +typedef void (*zend_object_set_t)(zval **property, zval *value TSRMLS_DC); + /* Used to get object value (most probably used in combination with -the result of the get_property_ptr or when converting object value to -one of the basic types) */ + * the result of the get_property_ptr or when converting object value to + * one of the basic types) + */ +typedef zval* (*zend_object_get_t)(zval *property TSRMLS_DC); -typedef int (*zend_object_has_property_t)(zval *object, zval *member, int check_empty TSRMLS_DC); /* Used to check if a property of the object exists */ -typedef void (*zend_object_unset_property_t)(zval *object, zval *member TSRMLS_DC); +typedef int (*zend_object_has_property_t)(zval *object, zval *member, int check_empty TSRMLS_DC); + /* Used to remove a property of the object */ +typedef void (*zend_object_unset_property_t)(zval *object, zval *member TSRMLS_DC); -typedef HashTable *(*zend_object_get_properties_t)(zval *object TSRMLS_DC); /* Used to get hash of the properties of the object, as hash of zval's */ +typedef HashTable *(*zend_object_get_properties_t)(zval *object TSRMLS_DC); -typedef int (*zend_object_call_method_t)(char *method, INTERNAL_FUNCTION_PARAMETERS); /* Used to call methods */ /* args on stack! */ -/* Andi - EX(fbc) (function being called) needs to be initialized already in the INIT fcall opcode so that the parameters can be parsed the right way. We need to add another callback fror this. -*/ +/* Andi - EX(fbc) (function being called) needs to be initialized already in the INIT fcall opcode so that the parameters can be parsed the right way. We need to add another callback for this. + */ +typedef int (*zend_object_call_method_t)(char *method, INTERNAL_FUNCTION_PARAMETERS); typedef union _zend_function *(*zend_object_get_method_t)(zval *object, char *method, int method_len TSRMLS_DC); typedef union _zend_function *(*zend_object_get_constructor_t)(zval *object TSRMLS_DC); -/* Get method parameter mask - by value/by reference, etc. */ /* Object maintenance/destruction */ typedef void (*zend_object_add_ref_t)(zval *object TSRMLS_DC); @@ -79,6 +88,7 @@ /* individual object functions */ zend_object_read_property_t read_property; zend_object_write_property_t write_property; + zend_object_write_dimension_t write_dimension; zend_object_get_property_ptr_t get_property_ptr; zend_object_get_property_zval_ptr_t get_property_zval_ptr; zend_object_get_t get;