Back to index

php5  5.3.10
zend_vm_def.h
Go to the documentation of this file.
00001 /*
00002    +----------------------------------------------------------------------+
00003    | Zend Engine                                                          |
00004    +----------------------------------------------------------------------+
00005    | Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) |
00006    +----------------------------------------------------------------------+
00007    | This source file is subject to version 2.00 of the Zend license,     |
00008    | that is bundled with this package in the file LICENSE, and is        |
00009    | available through the world-wide-web at the following url:           |
00010    | http://www.zend.com/license/2_00.txt.                                |
00011    | If you did not receive a copy of the Zend license and are unable to  |
00012    | obtain it through the world-wide-web, please send a note to          |
00013    | license@zend.com so we can mail you a copy immediately.              |
00014    +----------------------------------------------------------------------+
00015    | Authors: Andi Gutmans <andi@zend.com>                                |
00016    |          Zeev Suraski <zeev@zend.com>                                |
00017    |          Dmitry Stogov <dmitry@zend.com>                             |
00018    +----------------------------------------------------------------------+
00019 */
00020 
00021 /* $Id: zend_vm_def.h 321634 2012-01-01 13:15:04Z felipe $ */
00022 
00023 /* If you change this file, please regenerate the zend_vm_execute.h and
00024  * zend_vm_opcodes.h files by running:
00025  * php zend_vm_gen.php
00026  */
00027 
00028 ZEND_VM_HANDLER(1, ZEND_ADD, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV)
00029 {
00030        zend_op *opline = EX(opline);
00031        zend_free_op free_op1, free_op2;
00032 
00033        add_function(&EX_T(opline->result.u.var).tmp_var,
00034               GET_OP1_ZVAL_PTR(BP_VAR_R),
00035               GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC);
00036        FREE_OP1();
00037        FREE_OP2();
00038        ZEND_VM_NEXT_OPCODE();
00039 }
00040 
00041 ZEND_VM_HANDLER(2, ZEND_SUB, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV)
00042 {
00043        zend_op *opline = EX(opline);
00044        zend_free_op free_op1, free_op2;
00045 
00046        sub_function(&EX_T(opline->result.u.var).tmp_var,
00047               GET_OP1_ZVAL_PTR(BP_VAR_R),
00048               GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC);
00049        FREE_OP1();
00050        FREE_OP2();
00051        ZEND_VM_NEXT_OPCODE();
00052 }
00053 
00054 ZEND_VM_HANDLER(3, ZEND_MUL, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV)
00055 {
00056        zend_op *opline = EX(opline);
00057        zend_free_op free_op1, free_op2;
00058 
00059        mul_function(&EX_T(opline->result.u.var).tmp_var,
00060               GET_OP1_ZVAL_PTR(BP_VAR_R),
00061               GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC);
00062        FREE_OP1();
00063        FREE_OP2();
00064        ZEND_VM_NEXT_OPCODE();
00065 }
00066 
00067 ZEND_VM_HANDLER(4, ZEND_DIV, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV)
00068 {
00069        zend_op *opline = EX(opline);
00070        zend_free_op free_op1, free_op2;
00071 
00072        div_function(&EX_T(opline->result.u.var).tmp_var,
00073               GET_OP1_ZVAL_PTR(BP_VAR_R),
00074               GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC);
00075        FREE_OP1();
00076        FREE_OP2();
00077        ZEND_VM_NEXT_OPCODE();
00078 }
00079 
00080 ZEND_VM_HANDLER(5, ZEND_MOD, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV)
00081 {
00082        zend_op *opline = EX(opline);
00083        zend_free_op free_op1, free_op2;
00084 
00085        mod_function(&EX_T(opline->result.u.var).tmp_var,
00086               GET_OP1_ZVAL_PTR(BP_VAR_R),
00087               GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC);
00088        FREE_OP1();
00089        FREE_OP2();
00090        ZEND_VM_NEXT_OPCODE();
00091 }
00092 
00093 ZEND_VM_HANDLER(6, ZEND_SL, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV)
00094 {
00095        zend_op *opline = EX(opline);
00096        zend_free_op free_op1, free_op2;
00097 
00098        shift_left_function(&EX_T(opline->result.u.var).tmp_var,
00099               GET_OP1_ZVAL_PTR(BP_VAR_R),
00100               GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC);
00101        FREE_OP1();
00102        FREE_OP2();
00103        ZEND_VM_NEXT_OPCODE();
00104 }
00105 
00106 ZEND_VM_HANDLER(7, ZEND_SR, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV)
00107 {
00108        zend_op *opline = EX(opline);
00109        zend_free_op free_op1, free_op2;
00110 
00111        shift_right_function(&EX_T(opline->result.u.var).tmp_var,
00112               GET_OP1_ZVAL_PTR(BP_VAR_R),
00113               GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC);
00114        FREE_OP1();
00115        FREE_OP2();
00116        ZEND_VM_NEXT_OPCODE();
00117 }
00118 
00119 ZEND_VM_HANDLER(8, ZEND_CONCAT, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV)
00120 {
00121        zend_op *opline = EX(opline);
00122        zend_free_op free_op1, free_op2;
00123 
00124        concat_function(&EX_T(opline->result.u.var).tmp_var,
00125               GET_OP1_ZVAL_PTR(BP_VAR_R),
00126               GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC);
00127        FREE_OP1();
00128        FREE_OP2();
00129        ZEND_VM_NEXT_OPCODE();
00130 }
00131 
00132 ZEND_VM_HANDLER(15, ZEND_IS_IDENTICAL, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV)
00133 {
00134        zend_op *opline = EX(opline);
00135        zend_free_op free_op1, free_op2;
00136 
00137        is_identical_function(&EX_T(opline->result.u.var).tmp_var,
00138               GET_OP1_ZVAL_PTR(BP_VAR_R),
00139               GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC);
00140        FREE_OP1();
00141        FREE_OP2();
00142        ZEND_VM_NEXT_OPCODE();
00143 }
00144 
00145 ZEND_VM_HANDLER(16, ZEND_IS_NOT_IDENTICAL, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV)
00146 {
00147        zend_op *opline = EX(opline);
00148        zend_free_op free_op1, free_op2;
00149        zval *result = &EX_T(opline->result.u.var).tmp_var;
00150 
00151        is_identical_function(result,
00152               GET_OP1_ZVAL_PTR(BP_VAR_R),
00153               GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC);
00154        Z_LVAL_P(result) = !Z_LVAL_P(result);
00155        FREE_OP1();
00156        FREE_OP2();
00157        ZEND_VM_NEXT_OPCODE();
00158 }
00159 
00160 ZEND_VM_HANDLER(17, ZEND_IS_EQUAL, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV)
00161 {
00162        zend_op *opline = EX(opline);
00163        zend_free_op free_op1, free_op2;
00164        zval *result = &EX_T(opline->result.u.var).tmp_var;
00165 
00166        compare_function(result,
00167               GET_OP1_ZVAL_PTR(BP_VAR_R),
00168               GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC);
00169        ZVAL_BOOL(result, (Z_LVAL_P(result) == 0));
00170        FREE_OP1();
00171        FREE_OP2();
00172        ZEND_VM_NEXT_OPCODE();
00173 }
00174 
00175 ZEND_VM_HANDLER(18, ZEND_IS_NOT_EQUAL, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV)
00176 {
00177        zend_op *opline = EX(opline);
00178        zend_free_op free_op1, free_op2;
00179        zval *result = &EX_T(opline->result.u.var).tmp_var;
00180 
00181        compare_function(result,
00182               GET_OP1_ZVAL_PTR(BP_VAR_R),
00183               GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC);
00184        ZVAL_BOOL(result, (Z_LVAL_P(result) != 0));
00185        FREE_OP1();
00186        FREE_OP2();
00187        ZEND_VM_NEXT_OPCODE();
00188 }
00189 
00190 ZEND_VM_HANDLER(19, ZEND_IS_SMALLER, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV)
00191 {
00192        zend_op *opline = EX(opline);
00193        zend_free_op free_op1, free_op2;
00194        zval *result = &EX_T(opline->result.u.var).tmp_var;
00195 
00196        compare_function(result,
00197               GET_OP1_ZVAL_PTR(BP_VAR_R),
00198               GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC);
00199        ZVAL_BOOL(result, (Z_LVAL_P(result) < 0));
00200        FREE_OP1();
00201        FREE_OP2();
00202        ZEND_VM_NEXT_OPCODE();
00203 }
00204 
00205 ZEND_VM_HANDLER(20, ZEND_IS_SMALLER_OR_EQUAL, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV)
00206 {
00207        zend_op *opline = EX(opline);
00208        zend_free_op free_op1, free_op2;
00209        zval *result = &EX_T(opline->result.u.var).tmp_var;
00210 
00211        compare_function(result,
00212               GET_OP1_ZVAL_PTR(BP_VAR_R),
00213               GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC);
00214        ZVAL_BOOL(result, (Z_LVAL_P(result) <= 0));
00215        FREE_OP1();
00216        FREE_OP2();
00217        ZEND_VM_NEXT_OPCODE();
00218 }
00219 
00220 ZEND_VM_HANDLER(9, ZEND_BW_OR, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV)
00221 {
00222        zend_op *opline = EX(opline);
00223        zend_free_op free_op1, free_op2;
00224 
00225        bitwise_or_function(&EX_T(opline->result.u.var).tmp_var,
00226               GET_OP1_ZVAL_PTR(BP_VAR_R),
00227               GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC);
00228        FREE_OP1();
00229        FREE_OP2();
00230        ZEND_VM_NEXT_OPCODE();
00231 }
00232 
00233 ZEND_VM_HANDLER(10, ZEND_BW_AND, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV)
00234 {
00235        zend_op *opline = EX(opline);
00236        zend_free_op free_op1, free_op2;
00237 
00238        bitwise_and_function(&EX_T(opline->result.u.var).tmp_var,
00239               GET_OP1_ZVAL_PTR(BP_VAR_R),
00240               GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC);
00241        FREE_OP1();
00242        FREE_OP2();
00243        ZEND_VM_NEXT_OPCODE();
00244 }
00245 
00246 ZEND_VM_HANDLER(11, ZEND_BW_XOR, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV)
00247 {
00248        zend_op *opline = EX(opline);
00249        zend_free_op free_op1, free_op2;
00250 
00251        bitwise_xor_function(&EX_T(opline->result.u.var).tmp_var,
00252               GET_OP1_ZVAL_PTR(BP_VAR_R),
00253               GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC);
00254        FREE_OP1();
00255        FREE_OP2();
00256        ZEND_VM_NEXT_OPCODE();
00257 }
00258 
00259 ZEND_VM_HANDLER(14, ZEND_BOOL_XOR, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV)
00260 {
00261        zend_op *opline = EX(opline);
00262        zend_free_op free_op1, free_op2;
00263 
00264        boolean_xor_function(&EX_T(opline->result.u.var).tmp_var,
00265               GET_OP1_ZVAL_PTR(BP_VAR_R),
00266               GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC);
00267        FREE_OP1();
00268        FREE_OP2();
00269        ZEND_VM_NEXT_OPCODE();
00270 }
00271 
00272 ZEND_VM_HANDLER(12, ZEND_BW_NOT, CONST|TMP|VAR|CV, ANY)
00273 {
00274        zend_op *opline = EX(opline);
00275        zend_free_op free_op1;
00276 
00277        bitwise_not_function(&EX_T(opline->result.u.var).tmp_var,
00278               GET_OP1_ZVAL_PTR(BP_VAR_R) TSRMLS_CC);
00279        FREE_OP1();
00280        ZEND_VM_NEXT_OPCODE();
00281 }
00282 
00283 ZEND_VM_HANDLER(13, ZEND_BOOL_NOT, CONST|TMP|VAR|CV, ANY)
00284 {
00285        zend_op *opline = EX(opline);
00286        zend_free_op free_op1;
00287 
00288        boolean_not_function(&EX_T(opline->result.u.var).tmp_var,
00289               GET_OP1_ZVAL_PTR(BP_VAR_R) TSRMLS_CC);
00290        FREE_OP1();
00291        ZEND_VM_NEXT_OPCODE();
00292 }
00293 
00294 ZEND_VM_HELPER_EX(zend_binary_assign_op_obj_helper, VAR|UNUSED|CV, CONST|TMP|VAR|UNUSED|CV, int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC))
00295 {
00296        zend_op *opline = EX(opline);
00297        zend_op *op_data = opline+1;
00298        zend_free_op free_op1, free_op2, free_op_data1;
00299        zval **object_ptr = GET_OP1_OBJ_ZVAL_PTR_PTR(BP_VAR_W);
00300        zval *object;
00301        zval *property = GET_OP2_ZVAL_PTR(BP_VAR_R);
00302        zval *value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R);
00303        znode *result = &opline->result;
00304        int have_get_ptr = 0;
00305 
00306        if (OP1_TYPE == IS_VAR && !object_ptr) {
00307               zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
00308        }
00309 
00310        EX_T(result->u.var).var.ptr_ptr = NULL;
00311        make_real_object(object_ptr TSRMLS_CC);
00312        object = *object_ptr;
00313 
00314        if (Z_TYPE_P(object) != IS_OBJECT) {
00315               zend_error(E_WARNING, "Attempt to assign property of non-object");
00316               FREE_OP2();
00317               FREE_OP(free_op_data1);
00318 
00319               if (!RETURN_VALUE_UNUSED(result)) {
00320                      EX_T(result->u.var).var.ptr = EG(uninitialized_zval_ptr);
00321                      EX_T(result->u.var).var.ptr_ptr = NULL;
00322                      PZVAL_LOCK(EG(uninitialized_zval_ptr));
00323               }
00324        } else {
00325               /* here we are sure we are dealing with an object */
00326               if (IS_OP2_TMP_FREE()) {
00327                      MAKE_REAL_ZVAL_PTR(property);
00328               }
00329 
00330               /* here property is a string */
00331               if (opline->extended_value == ZEND_ASSIGN_OBJ
00332                      && Z_OBJ_HT_P(object)->get_property_ptr_ptr) {
00333                      zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property TSRMLS_CC);
00334                      if (zptr != NULL) {                /* NULL means no success in getting PTR */
00335                             SEPARATE_ZVAL_IF_NOT_REF(zptr);
00336 
00337                             have_get_ptr = 1;
00338                             binary_op(*zptr, *zptr, value TSRMLS_CC);
00339                             if (!RETURN_VALUE_UNUSED(result)) {
00340                                    EX_T(result->u.var).var.ptr = *zptr;
00341                                    EX_T(result->u.var).var.ptr_ptr = NULL;
00342                                    PZVAL_LOCK(*zptr);
00343                             }
00344                      }
00345               }
00346 
00347               if (!have_get_ptr) {
00348                      zval *z = NULL;
00349 
00350                      if (opline->extended_value == ZEND_ASSIGN_OBJ) {
00351                             if (Z_OBJ_HT_P(object)->read_property) {
00352                                    z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R TSRMLS_CC);
00353                             }
00354                      } else /* if (opline->extended_value == ZEND_ASSIGN_DIM) */ {
00355                             if (Z_OBJ_HT_P(object)->read_dimension) {
00356                                    z = Z_OBJ_HT_P(object)->read_dimension(object, property, BP_VAR_R TSRMLS_CC);
00357                             }
00358                      }
00359                      if (z) {
00360                             if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) {
00361                                    zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
00362 
00363                                    if (Z_REFCOUNT_P(z) == 0) {
00364                                           GC_REMOVE_ZVAL_FROM_BUFFER(z);
00365                                           zval_dtor(z);
00366                                           FREE_ZVAL(z);
00367                                    }
00368                                    z = value;
00369                             }
00370                             Z_ADDREF_P(z);
00371                             SEPARATE_ZVAL_IF_NOT_REF(&z);
00372                             binary_op(z, z, value TSRMLS_CC);
00373                             if (opline->extended_value == ZEND_ASSIGN_OBJ) {
00374                                    Z_OBJ_HT_P(object)->write_property(object, property, z TSRMLS_CC);
00375                             } else /* if (opline->extended_value == ZEND_ASSIGN_DIM) */ {
00376                                    Z_OBJ_HT_P(object)->write_dimension(object, property, z TSRMLS_CC);
00377                             }
00378                             if (!RETURN_VALUE_UNUSED(result)) {
00379                                    EX_T(result->u.var).var.ptr = z;
00380                                    EX_T(result->u.var).var.ptr_ptr = NULL;
00381                                    PZVAL_LOCK(z);
00382                             }
00383                             zval_ptr_dtor(&z);
00384                      } else {
00385                             zend_error(E_WARNING, "Attempt to assign property of non-object");
00386                             if (!RETURN_VALUE_UNUSED(result)) {
00387                                    EX_T(result->u.var).var.ptr = EG(uninitialized_zval_ptr);
00388                                    EX_T(result->u.var).var.ptr_ptr = NULL;
00389                                    PZVAL_LOCK(EG(uninitialized_zval_ptr));
00390                             }
00391                      }
00392               }
00393 
00394               if (IS_OP2_TMP_FREE()) {
00395                      zval_ptr_dtor(&property);
00396               } else {
00397                      FREE_OP2();
00398               }
00399               FREE_OP(free_op_data1);
00400        }
00401 
00402        FREE_OP1_VAR_PTR();
00403        /* assign_obj has two opcodes! */
00404        ZEND_VM_INC_OPCODE();
00405        ZEND_VM_NEXT_OPCODE();
00406 }
00407 
00408 ZEND_VM_HELPER_EX(zend_binary_assign_op_helper, VAR|UNUSED|CV, CONST|TMP|VAR|UNUSED|CV, int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC))
00409 {
00410        zend_op *opline = EX(opline);
00411        zend_free_op free_op1, free_op2, free_op_data2, free_op_data1;
00412        zval **var_ptr;
00413        zval *value;
00414 
00415        switch (opline->extended_value) {
00416               case ZEND_ASSIGN_OBJ:
00417                      ZEND_VM_DISPATCH_TO_HELPER_EX(zend_binary_assign_op_obj_helper, binary_op, binary_op);
00418                      break;
00419               case ZEND_ASSIGN_DIM: {
00420                             zval **container = GET_OP1_OBJ_ZVAL_PTR_PTR(BP_VAR_RW);
00421 
00422                             if (OP1_TYPE == IS_VAR && !container) {
00423                                    zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
00424                             } else if (Z_TYPE_PP(container) == IS_OBJECT) {
00425                                    if (OP1_TYPE == IS_VAR && !OP1_FREE) {
00426                                           Z_ADDREF_PP(container);  /* undo the effect of get_obj_zval_ptr_ptr() */
00427                                    }
00428                                    ZEND_VM_DISPATCH_TO_HELPER_EX(zend_binary_assign_op_obj_helper, binary_op, binary_op);
00429                             } else {
00430                                    zend_op *op_data = opline+1;
00431                                    zval *dim = GET_OP2_ZVAL_PTR(BP_VAR_R);
00432 
00433                                    zend_fetch_dimension_address(&EX_T(op_data->op2.u.var), container, dim, IS_OP2_TMP_FREE(), BP_VAR_RW TSRMLS_CC);
00434                                    value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R);
00435                                    var_ptr = _get_zval_ptr_ptr_var(&op_data->op2, EX(Ts), &free_op_data2 TSRMLS_CC);
00436                                    ZEND_VM_INC_OPCODE();
00437                             }
00438                      }
00439                      break;
00440               default:
00441                      value = GET_OP2_ZVAL_PTR(BP_VAR_R);
00442                      var_ptr = GET_OP1_ZVAL_PTR_PTR(BP_VAR_RW);
00443                      /* do nothing */
00444                      break;
00445        }
00446 
00447        if (!var_ptr) {
00448               zend_error_noreturn(E_ERROR, "Cannot use assign-op operators with overloaded objects nor string offsets");
00449        }
00450 
00451        if (*var_ptr == EG(error_zval_ptr)) {
00452               if (!RETURN_VALUE_UNUSED(&opline->result)) {
00453                      AI_SET_PTR(EX_T(opline->result.u.var).var, EG(uninitialized_zval_ptr));
00454                      PZVAL_LOCK(EG(uninitialized_zval_ptr));
00455               }
00456               FREE_OP2();
00457               FREE_OP1_VAR_PTR();
00458               ZEND_VM_NEXT_OPCODE();
00459        }
00460 
00461        SEPARATE_ZVAL_IF_NOT_REF(var_ptr);
00462 
00463        if(Z_TYPE_PP(var_ptr) == IS_OBJECT && Z_OBJ_HANDLER_PP(var_ptr, get)
00464           && Z_OBJ_HANDLER_PP(var_ptr, set)) {
00465               /* proxy object */
00466               zval *objval = Z_OBJ_HANDLER_PP(var_ptr, get)(*var_ptr TSRMLS_CC);
00467               Z_ADDREF_P(objval);
00468               binary_op(objval, objval, value TSRMLS_CC);
00469               Z_OBJ_HANDLER_PP(var_ptr, set)(var_ptr, objval TSRMLS_CC);
00470               zval_ptr_dtor(&objval);
00471        } else {
00472               binary_op(*var_ptr, *var_ptr, value TSRMLS_CC);
00473        }
00474 
00475        if (!RETURN_VALUE_UNUSED(&opline->result)) {
00476               AI_SET_PTR(EX_T(opline->result.u.var).var, *var_ptr);
00477               PZVAL_LOCK(*var_ptr);
00478        }
00479        FREE_OP2();
00480 
00481        if (opline->extended_value == ZEND_ASSIGN_DIM) {
00482               FREE_OP(free_op_data1);
00483               FREE_OP_VAR_PTR(free_op_data2);
00484        }
00485        FREE_OP1_VAR_PTR();
00486        ZEND_VM_NEXT_OPCODE();
00487 }
00488 
00489 ZEND_VM_HANDLER(23, ZEND_ASSIGN_ADD, VAR|UNUSED|CV, CONST|TMP|VAR|UNUSED|CV)
00490 {
00491        ZEND_VM_DISPATCH_TO_HELPER_EX(zend_binary_assign_op_helper, binary_op, add_function);
00492 }
00493 
00494 ZEND_VM_HANDLER(24, ZEND_ASSIGN_SUB, VAR|UNUSED|CV, CONST|TMP|VAR|UNUSED|CV)
00495 {
00496        ZEND_VM_DISPATCH_TO_HELPER_EX(zend_binary_assign_op_helper, binary_op, sub_function);
00497 }
00498 
00499 ZEND_VM_HANDLER(25, ZEND_ASSIGN_MUL, VAR|UNUSED|CV, CONST|TMP|VAR|UNUSED|CV)
00500 {
00501        ZEND_VM_DISPATCH_TO_HELPER_EX(zend_binary_assign_op_helper, binary_op, mul_function);
00502 }
00503 
00504 ZEND_VM_HANDLER(26, ZEND_ASSIGN_DIV, VAR|UNUSED|CV, CONST|TMP|VAR|UNUSED|CV)
00505 {
00506        ZEND_VM_DISPATCH_TO_HELPER_EX(zend_binary_assign_op_helper, binary_op, div_function);
00507 }
00508 
00509 ZEND_VM_HANDLER(27, ZEND_ASSIGN_MOD, VAR|UNUSED|CV, CONST|TMP|VAR|UNUSED|CV)
00510 {
00511        ZEND_VM_DISPATCH_TO_HELPER_EX(zend_binary_assign_op_helper, binary_op, mod_function);
00512 }
00513 
00514 ZEND_VM_HANDLER(28, ZEND_ASSIGN_SL, VAR|UNUSED|CV, CONST|TMP|VAR|UNUSED|CV)
00515 {
00516        ZEND_VM_DISPATCH_TO_HELPER_EX(zend_binary_assign_op_helper, binary_op, shift_left_function);
00517 }
00518 
00519 ZEND_VM_HANDLER(29, ZEND_ASSIGN_SR, VAR|UNUSED|CV, CONST|TMP|VAR|UNUSED|CV)
00520 {
00521        ZEND_VM_DISPATCH_TO_HELPER_EX(zend_binary_assign_op_helper, binary_op, shift_right_function);
00522 }
00523 
00524 ZEND_VM_HANDLER(30, ZEND_ASSIGN_CONCAT, VAR|UNUSED|CV, CONST|TMP|VAR|UNUSED|CV)
00525 {
00526        ZEND_VM_DISPATCH_TO_HELPER_EX(zend_binary_assign_op_helper, binary_op, concat_function);
00527 }
00528 
00529 ZEND_VM_HANDLER(31, ZEND_ASSIGN_BW_OR, VAR|UNUSED|CV, CONST|TMP|VAR|UNUSED|CV)
00530 {
00531        ZEND_VM_DISPATCH_TO_HELPER_EX(zend_binary_assign_op_helper, binary_op, bitwise_or_function);
00532 }
00533 
00534 ZEND_VM_HANDLER(32, ZEND_ASSIGN_BW_AND, VAR|UNUSED|CV, CONST|TMP|VAR|UNUSED|CV)
00535 {
00536        ZEND_VM_DISPATCH_TO_HELPER_EX(zend_binary_assign_op_helper, binary_op, bitwise_and_function);
00537 }
00538 
00539 ZEND_VM_HANDLER(33, ZEND_ASSIGN_BW_XOR, VAR|UNUSED|CV, CONST|TMP|VAR|UNUSED|CV)
00540 {
00541        ZEND_VM_DISPATCH_TO_HELPER_EX(zend_binary_assign_op_helper, binary_op, bitwise_xor_function);
00542 }
00543 
00544 ZEND_VM_HELPER_EX(zend_pre_incdec_property_helper, VAR|UNUSED|CV, CONST|TMP|VAR|CV, incdec_t incdec_op)
00545 {
00546        zend_op *opline = EX(opline);
00547        zend_free_op free_op1, free_op2;
00548        zval **object_ptr = GET_OP1_OBJ_ZVAL_PTR_PTR(BP_VAR_W);
00549        zval *object;
00550        zval *property = GET_OP2_ZVAL_PTR(BP_VAR_R);
00551        zval **retval = &EX_T(opline->result.u.var).var.ptr;
00552        int have_get_ptr = 0;
00553 
00554        if (OP1_TYPE == IS_VAR && !object_ptr) {
00555               zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets");
00556        }
00557 
00558        make_real_object(object_ptr TSRMLS_CC); /* this should modify object only if it's empty */
00559        object = *object_ptr;
00560 
00561        if (Z_TYPE_P(object) != IS_OBJECT) {
00562               zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
00563               FREE_OP2();
00564               if (!RETURN_VALUE_UNUSED(&opline->result)) {
00565                      *retval = EG(uninitialized_zval_ptr);
00566                      PZVAL_LOCK(*retval);
00567               }
00568               FREE_OP1_VAR_PTR();
00569               ZEND_VM_NEXT_OPCODE();
00570        }
00571 
00572        /* here we are sure we are dealing with an object */
00573 
00574        if (IS_OP2_TMP_FREE()) {
00575               MAKE_REAL_ZVAL_PTR(property);
00576        }
00577 
00578        if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) {
00579               zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property TSRMLS_CC);
00580               if (zptr != NULL) {                /* NULL means no success in getting PTR */
00581                      SEPARATE_ZVAL_IF_NOT_REF(zptr);
00582 
00583                      have_get_ptr = 1;
00584                      incdec_op(*zptr);
00585                      if (!RETURN_VALUE_UNUSED(&opline->result)) {
00586                             *retval = *zptr;
00587                             PZVAL_LOCK(*retval);
00588                      }
00589               }
00590        }
00591 
00592        if (!have_get_ptr) {
00593               if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) {
00594                      zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R TSRMLS_CC);
00595 
00596                      if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) {
00597                             zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
00598 
00599                             if (Z_REFCOUNT_P(z) == 0) {
00600                                    GC_REMOVE_ZVAL_FROM_BUFFER(z);
00601                                    zval_dtor(z);
00602                                    FREE_ZVAL(z);
00603                             }
00604                             z = value;
00605                      }
00606                      Z_ADDREF_P(z);
00607                      SEPARATE_ZVAL_IF_NOT_REF(&z);
00608                      incdec_op(z);
00609                      *retval = z;
00610                      Z_OBJ_HT_P(object)->write_property(object, property, z TSRMLS_CC);
00611                      SELECTIVE_PZVAL_LOCK(*retval, &opline->result);
00612                      zval_ptr_dtor(&z);
00613               } else {
00614                      zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
00615                      if (!RETURN_VALUE_UNUSED(&opline->result)) {
00616                             *retval = EG(uninitialized_zval_ptr);
00617                             PZVAL_LOCK(*retval);
00618                      }
00619               }
00620        }
00621 
00622        if (IS_OP2_TMP_FREE()) {
00623               zval_ptr_dtor(&property);
00624        } else {
00625               FREE_OP2();
00626        }
00627        FREE_OP1_VAR_PTR();
00628        ZEND_VM_NEXT_OPCODE();
00629 }
00630 
00631 ZEND_VM_HANDLER(132, ZEND_PRE_INC_OBJ, VAR|UNUSED|CV, CONST|TMP|VAR|CV)
00632 {
00633        ZEND_VM_DISPATCH_TO_HELPER_EX(zend_pre_incdec_property_helper, incdec_op, increment_function);
00634 }
00635 
00636 ZEND_VM_HANDLER(133, ZEND_PRE_DEC_OBJ, VAR|UNUSED|CV, CONST|TMP|VAR|CV)
00637 {
00638        ZEND_VM_DISPATCH_TO_HELPER_EX(zend_pre_incdec_property_helper, incdec_op, decrement_function);
00639 }
00640 
00641 ZEND_VM_HELPER_EX(zend_post_incdec_property_helper, VAR|UNUSED|CV, CONST|TMP|VAR|CV, incdec_t incdec_op)
00642 {
00643        zend_op *opline = EX(opline);
00644        zend_free_op free_op1, free_op2;
00645        zval **object_ptr = GET_OP1_OBJ_ZVAL_PTR_PTR(BP_VAR_W);
00646        zval *object;
00647        zval *property = GET_OP2_ZVAL_PTR(BP_VAR_R);
00648        zval *retval = &EX_T(opline->result.u.var).tmp_var;
00649        int have_get_ptr = 0;
00650 
00651        if (OP1_TYPE == IS_VAR && !object_ptr) {
00652               zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets");
00653        }
00654 
00655        make_real_object(object_ptr TSRMLS_CC); /* this should modify object only if it's empty */
00656        object = *object_ptr;
00657 
00658        if (Z_TYPE_P(object) != IS_OBJECT) {
00659               zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
00660               FREE_OP2();
00661               *retval = *EG(uninitialized_zval_ptr);
00662               FREE_OP1_VAR_PTR();
00663               ZEND_VM_NEXT_OPCODE();
00664        }
00665 
00666        /* here we are sure we are dealing with an object */
00667 
00668        if (IS_OP2_TMP_FREE()) {
00669               MAKE_REAL_ZVAL_PTR(property);
00670        }
00671 
00672        if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) {
00673               zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property TSRMLS_CC);
00674               if (zptr != NULL) {                /* NULL means no success in getting PTR */
00675                      have_get_ptr = 1;
00676                      SEPARATE_ZVAL_IF_NOT_REF(zptr);
00677 
00678                      *retval = **zptr;
00679                      zendi_zval_copy_ctor(*retval);
00680 
00681                      incdec_op(*zptr);
00682 
00683               }
00684        }
00685 
00686        if (!have_get_ptr) {
00687               if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) {
00688                      zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R TSRMLS_CC);
00689                      zval *z_copy;
00690 
00691                      if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) {
00692                             zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
00693 
00694                             if (Z_REFCOUNT_P(z) == 0) {
00695                                    GC_REMOVE_ZVAL_FROM_BUFFER(z);
00696                                    zval_dtor(z);
00697                                    FREE_ZVAL(z);
00698                             }
00699                             z = value;
00700                      }
00701                      *retval = *z;
00702                      zendi_zval_copy_ctor(*retval);
00703                      ALLOC_ZVAL(z_copy);
00704                      *z_copy = *z;
00705                      zendi_zval_copy_ctor(*z_copy);
00706                      INIT_PZVAL(z_copy);
00707                      incdec_op(z_copy);
00708                      Z_ADDREF_P(z);
00709                      Z_OBJ_HT_P(object)->write_property(object, property, z_copy TSRMLS_CC);
00710                      zval_ptr_dtor(&z_copy);
00711                      zval_ptr_dtor(&z);
00712               } else {
00713                      zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
00714                      *retval = *EG(uninitialized_zval_ptr);
00715               }
00716        }
00717 
00718        if (IS_OP2_TMP_FREE()) {
00719               zval_ptr_dtor(&property);
00720        } else {
00721               FREE_OP2();
00722        }
00723        FREE_OP1_VAR_PTR();
00724        ZEND_VM_NEXT_OPCODE();
00725 }
00726 
00727 ZEND_VM_HANDLER(134, ZEND_POST_INC_OBJ, VAR|UNUSED|CV, CONST|TMP|VAR|CV)
00728 {
00729        ZEND_VM_DISPATCH_TO_HELPER_EX(zend_post_incdec_property_helper, incdec_op, increment_function);
00730 }
00731 
00732 ZEND_VM_HANDLER(135, ZEND_POST_DEC_OBJ, VAR|UNUSED|CV, CONST|TMP|VAR|CV)
00733 {
00734        ZEND_VM_DISPATCH_TO_HELPER_EX(zend_post_incdec_property_helper, incdec_op, decrement_function);
00735 }
00736 
00737 ZEND_VM_HANDLER(34, ZEND_PRE_INC, VAR|CV, ANY)
00738 {
00739        zend_op *opline = EX(opline);
00740        zend_free_op free_op1;
00741        zval **var_ptr = GET_OP1_ZVAL_PTR_PTR(BP_VAR_RW);
00742 
00743        if (OP1_TYPE == IS_VAR && !var_ptr) {
00744               zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets");
00745        }
00746        if (OP1_TYPE == IS_VAR && *var_ptr == EG(error_zval_ptr)) {
00747               if (!RETURN_VALUE_UNUSED(&opline->result)) {
00748                      AI_SET_PTR(EX_T(opline->result.u.var).var, EG(uninitialized_zval_ptr));
00749                      PZVAL_LOCK(EG(uninitialized_zval_ptr));
00750               }
00751               FREE_OP1_VAR_PTR();
00752               ZEND_VM_NEXT_OPCODE();
00753        }
00754 
00755        SEPARATE_ZVAL_IF_NOT_REF(var_ptr);
00756 
00757        if(Z_TYPE_PP(var_ptr) == IS_OBJECT && Z_OBJ_HANDLER_PP(var_ptr, get)
00758           && Z_OBJ_HANDLER_PP(var_ptr, set)) {
00759               /* proxy object */
00760               zval *val = Z_OBJ_HANDLER_PP(var_ptr, get)(*var_ptr TSRMLS_CC);
00761               Z_ADDREF_P(val);
00762               increment_function(val);
00763               Z_OBJ_HANDLER_PP(var_ptr, set)(var_ptr, val TSRMLS_CC);
00764               zval_ptr_dtor(&val);
00765        } else {
00766               increment_function(*var_ptr);
00767        }
00768 
00769        if (!RETURN_VALUE_UNUSED(&opline->result)) {
00770               AI_SET_PTR(EX_T(opline->result.u.var).var, *var_ptr);
00771               PZVAL_LOCK(*var_ptr);
00772        }
00773 
00774        FREE_OP1_VAR_PTR();
00775        ZEND_VM_NEXT_OPCODE();
00776 }
00777 
00778 ZEND_VM_HANDLER(35, ZEND_PRE_DEC, VAR|CV, ANY)
00779 {
00780        zend_op *opline = EX(opline);
00781        zend_free_op free_op1;
00782        zval **var_ptr = GET_OP1_ZVAL_PTR_PTR(BP_VAR_RW);
00783 
00784        if (OP1_TYPE == IS_VAR && !var_ptr) {
00785               zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets");
00786        }
00787        if (OP1_TYPE == IS_VAR && *var_ptr == EG(error_zval_ptr)) {
00788               if (!RETURN_VALUE_UNUSED(&opline->result)) {
00789                      AI_SET_PTR(EX_T(opline->result.u.var).var, EG(uninitialized_zval_ptr));
00790                      PZVAL_LOCK(EG(uninitialized_zval_ptr));
00791               }
00792               FREE_OP1_VAR_PTR();
00793               ZEND_VM_NEXT_OPCODE();
00794        }
00795 
00796        SEPARATE_ZVAL_IF_NOT_REF(var_ptr);
00797 
00798        if(Z_TYPE_PP(var_ptr) == IS_OBJECT && Z_OBJ_HANDLER_PP(var_ptr, get)
00799           && Z_OBJ_HANDLER_PP(var_ptr, set)) {
00800               /* proxy object */
00801               zval *val = Z_OBJ_HANDLER_PP(var_ptr, get)(*var_ptr TSRMLS_CC);
00802               Z_ADDREF_P(val);
00803               decrement_function(val);
00804               Z_OBJ_HANDLER_PP(var_ptr, set)(var_ptr, val TSRMLS_CC);
00805               zval_ptr_dtor(&val);
00806        } else {
00807               decrement_function(*var_ptr);
00808        }
00809 
00810        if (!RETURN_VALUE_UNUSED(&opline->result)) {
00811               AI_SET_PTR(EX_T(opline->result.u.var).var, *var_ptr);
00812               PZVAL_LOCK(*var_ptr);
00813        }
00814 
00815        FREE_OP1_VAR_PTR();
00816        ZEND_VM_NEXT_OPCODE();
00817 }
00818 
00819 ZEND_VM_HANDLER(36, ZEND_POST_INC, VAR|CV, ANY)
00820 {
00821        zend_op *opline = EX(opline);
00822        zend_free_op free_op1;
00823        zval **var_ptr = GET_OP1_ZVAL_PTR_PTR(BP_VAR_RW);
00824 
00825        if (OP1_TYPE == IS_VAR && !var_ptr) {
00826               zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets");
00827        }
00828        if (OP1_TYPE == IS_VAR && *var_ptr == EG(error_zval_ptr)) {
00829               if (!RETURN_VALUE_UNUSED(&opline->result)) {
00830                      EX_T(opline->result.u.var).tmp_var = *EG(uninitialized_zval_ptr);
00831               }
00832               FREE_OP1_VAR_PTR();
00833               ZEND_VM_NEXT_OPCODE();
00834        }
00835 
00836        EX_T(opline->result.u.var).tmp_var = **var_ptr;
00837        zendi_zval_copy_ctor(EX_T(opline->result.u.var).tmp_var);
00838 
00839        SEPARATE_ZVAL_IF_NOT_REF(var_ptr);
00840 
00841        if(Z_TYPE_PP(var_ptr) == IS_OBJECT && Z_OBJ_HANDLER_PP(var_ptr, get)
00842           && Z_OBJ_HANDLER_PP(var_ptr, set)) {
00843               /* proxy object */
00844               zval *val = Z_OBJ_HANDLER_PP(var_ptr, get)(*var_ptr TSRMLS_CC);
00845               Z_ADDREF_P(val);
00846               increment_function(val);
00847               Z_OBJ_HANDLER_PP(var_ptr, set)(var_ptr, val TSRMLS_CC);
00848               zval_ptr_dtor(&val);
00849        } else {
00850               increment_function(*var_ptr);
00851        }
00852 
00853        FREE_OP1_VAR_PTR();
00854        ZEND_VM_NEXT_OPCODE();
00855 }
00856 
00857 ZEND_VM_HANDLER(37, ZEND_POST_DEC, VAR|CV, ANY)
00858 {
00859        zend_op *opline = EX(opline);
00860        zend_free_op free_op1;
00861        zval **var_ptr = GET_OP1_ZVAL_PTR_PTR(BP_VAR_RW);
00862 
00863        if (OP1_TYPE == IS_VAR && !var_ptr) {
00864               zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets");
00865        }
00866        if (OP1_TYPE == IS_VAR && *var_ptr == EG(error_zval_ptr)) {
00867               if (!RETURN_VALUE_UNUSED(&opline->result)) {
00868                      EX_T(opline->result.u.var).tmp_var = *EG(uninitialized_zval_ptr);
00869               }
00870               FREE_OP1_VAR_PTR();
00871               ZEND_VM_NEXT_OPCODE();
00872        }
00873 
00874        EX_T(opline->result.u.var).tmp_var = **var_ptr;
00875        zendi_zval_copy_ctor(EX_T(opline->result.u.var).tmp_var);
00876 
00877        SEPARATE_ZVAL_IF_NOT_REF(var_ptr);
00878 
00879        if(Z_TYPE_PP(var_ptr) == IS_OBJECT && Z_OBJ_HANDLER_PP(var_ptr, get)
00880           && Z_OBJ_HANDLER_PP(var_ptr, set)) {
00881               /* proxy object */
00882               zval *val = Z_OBJ_HANDLER_PP(var_ptr, get)(*var_ptr TSRMLS_CC);
00883               Z_ADDREF_P(val);
00884               decrement_function(val);
00885               Z_OBJ_HANDLER_PP(var_ptr, set)(var_ptr, val TSRMLS_CC);
00886               zval_ptr_dtor(&val);
00887        } else {
00888               decrement_function(*var_ptr);
00889        }
00890 
00891        FREE_OP1_VAR_PTR();
00892        ZEND_VM_NEXT_OPCODE();
00893 }
00894 
00895 ZEND_VM_HANDLER(40, ZEND_ECHO, CONST|TMP|VAR|CV, ANY)
00896 {
00897        zend_op *opline = EX(opline);
00898        zend_free_op free_op1;
00899        zval z_copy;
00900        zval *z = GET_OP1_ZVAL_PTR(BP_VAR_R);
00901 
00902        if (OP1_TYPE != IS_CONST &&
00903            Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get_method != NULL) {
00904            if (OP1_TYPE == IS_TMP_VAR) {
00905               INIT_PZVAL(z);
00906            }
00907               if (zend_std_cast_object_tostring(z, &z_copy, IS_STRING TSRMLS_CC) == SUCCESS) {
00908                      zend_print_variable(&z_copy);
00909                      zval_dtor(&z_copy);
00910               } else {
00911                      zend_print_variable(z);
00912               }
00913        } else {
00914               zend_print_variable(z);
00915        }
00916 
00917        FREE_OP1();
00918        ZEND_VM_NEXT_OPCODE();
00919 }
00920 
00921 ZEND_VM_HANDLER(41, ZEND_PRINT, CONST|TMP|VAR|CV, ANY)
00922 {
00923        zend_op *opline = EX(opline);
00924 
00925        Z_LVAL(EX_T(opline->result.u.var).tmp_var) = 1;
00926        Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_LONG;
00927 
00928        ZEND_VM_DISPATCH_TO_HANDLER(ZEND_ECHO);
00929 }
00930 
00931 ZEND_VM_HELPER_EX(zend_fetch_var_address_helper, CONST|TMP|VAR|CV, ANY, int type)
00932 {
00933        zend_op *opline = EX(opline);
00934        zend_free_op free_op1;
00935        zval *varname = GET_OP1_ZVAL_PTR(BP_VAR_R);
00936        zval **retval;
00937        zval tmp_varname;
00938        HashTable *target_symbol_table;
00939 
00940        if (OP1_TYPE != IS_CONST && Z_TYPE_P(varname) != IS_STRING) {
00941               tmp_varname = *varname;
00942               zval_copy_ctor(&tmp_varname);
00943               convert_to_string(&tmp_varname);
00944               varname = &tmp_varname;
00945        }
00946 
00947        if (opline->op2.u.EA.type == ZEND_FETCH_STATIC_MEMBER) {
00948               retval = zend_std_get_static_property(EX_T(opline->op2.u.var).class_entry, Z_STRVAL_P(varname), Z_STRLEN_P(varname), 0 TSRMLS_CC);
00949               FREE_OP1();
00950        } else {
00951               target_symbol_table = zend_get_target_symbol_table(opline, EX(Ts), type, varname TSRMLS_CC);
00952 /*
00953               if (!target_symbol_table) {
00954                      ZEND_VM_NEXT_OPCODE();
00955               }
00956 */
00957               if (zend_hash_find(target_symbol_table, varname->value.str.val, varname->value.str.len+1, (void **) &retval) == FAILURE) {
00958                      switch (type) {
00959                             case BP_VAR_R:
00960                             case BP_VAR_UNSET:
00961                                    zend_error(E_NOTICE,"Undefined variable: %s", Z_STRVAL_P(varname));
00962                                    /* break missing intentionally */
00963                             case BP_VAR_IS:
00964                                    retval = &EG(uninitialized_zval_ptr);
00965                                    break;
00966                             case BP_VAR_RW:
00967                                    zend_error(E_NOTICE,"Undefined variable: %s", Z_STRVAL_P(varname));
00968                                    /* break missing intentionally */
00969                             case BP_VAR_W: {
00970                                           zval *new_zval = &EG(uninitialized_zval);
00971 
00972                                           Z_ADDREF_P(new_zval);
00973                                           zend_hash_update(target_symbol_table, varname->value.str.val, varname->value.str.len+1, &new_zval, sizeof(zval *), (void **) &retval);
00974                                    }
00975                                    break;
00976                             EMPTY_SWITCH_DEFAULT_CASE()
00977                      }
00978               }
00979               switch (opline->op2.u.EA.type) {
00980                      case ZEND_FETCH_GLOBAL:
00981                             if (OP1_TYPE != IS_TMP_VAR) {
00982                                    FREE_OP1();
00983                             }
00984                             break;
00985                      case ZEND_FETCH_LOCAL:
00986                             FREE_OP1();
00987                             break;
00988                      case ZEND_FETCH_STATIC:
00989                             zval_update_constant(retval, (void*) 1 TSRMLS_CC);
00990                             break;
00991                      case ZEND_FETCH_GLOBAL_LOCK:
00992                             if (OP1_TYPE == IS_VAR && !free_op1.var) {
00993                                    PZVAL_LOCK(*EX_T(opline->op1.u.var).var.ptr_ptr);
00994                             }
00995                             break;
00996               }
00997        }
00998 
00999 
01000        if (OP1_TYPE != IS_CONST && varname == &tmp_varname) {
01001               zval_dtor(varname);
01002        }
01003        if (!RETURN_VALUE_UNUSED(&opline->result)) {
01004               if (opline->extended_value & ZEND_FETCH_MAKE_REF) {
01005                      SEPARATE_ZVAL_TO_MAKE_IS_REF(retval);
01006               }
01007               PZVAL_LOCK(*retval);
01008               switch (type) {
01009                      case BP_VAR_R:
01010                      case BP_VAR_IS:
01011                             AI_SET_PTR(EX_T(opline->result.u.var).var, *retval);
01012                             break;
01013                      case BP_VAR_UNSET: {
01014                             zend_free_op free_res;
01015 
01016                             EX_T(opline->result.u.var).var.ptr_ptr = retval;
01017                             PZVAL_UNLOCK(*EX_T(opline->result.u.var).var.ptr_ptr, &free_res);
01018                             if (EX_T(opline->result.u.var).var.ptr_ptr != &EG(uninitialized_zval_ptr)) {
01019                                    SEPARATE_ZVAL_IF_NOT_REF(EX_T(opline->result.u.var).var.ptr_ptr);
01020                             }
01021                             PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr);
01022                             FREE_OP_VAR_PTR(free_res);
01023                             break;
01024                      default:
01025                             EX_T(opline->result.u.var).var.ptr_ptr = retval;
01026                             break;
01027                      }
01028               }
01029        }
01030        ZEND_VM_NEXT_OPCODE();
01031 }
01032 
01033 ZEND_VM_HANDLER(80, ZEND_FETCH_R, CONST|TMP|VAR|CV, ANY)
01034 {
01035        ZEND_VM_DISPATCH_TO_HELPER_EX(zend_fetch_var_address_helper, type, BP_VAR_R);
01036 }
01037 
01038 ZEND_VM_HANDLER(83, ZEND_FETCH_W, CONST|TMP|VAR|CV, ANY)
01039 {
01040        ZEND_VM_DISPATCH_TO_HELPER_EX(zend_fetch_var_address_helper, type, BP_VAR_W);
01041 }
01042 
01043 ZEND_VM_HANDLER(86, ZEND_FETCH_RW, CONST|TMP|VAR|CV, ANY)
01044 {
01045        ZEND_VM_DISPATCH_TO_HELPER_EX(zend_fetch_var_address_helper, type, BP_VAR_RW);
01046 }
01047 
01048 ZEND_VM_HANDLER(92, ZEND_FETCH_FUNC_ARG, CONST|TMP|VAR|CV, ANY)
01049 {
01050        ZEND_VM_DISPATCH_TO_HELPER_EX(zend_fetch_var_address_helper, type,
01051               ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), EX(opline)->extended_value)?BP_VAR_W:BP_VAR_R);
01052 }
01053 
01054 ZEND_VM_HANDLER(95, ZEND_FETCH_UNSET, CONST|TMP|VAR|CV, ANY)
01055 {
01056        ZEND_VM_DISPATCH_TO_HELPER_EX(zend_fetch_var_address_helper, type, BP_VAR_UNSET);
01057 }
01058 
01059 ZEND_VM_HANDLER(89, ZEND_FETCH_IS, CONST|TMP|VAR|CV, ANY)
01060 {
01061        ZEND_VM_DISPATCH_TO_HELPER_EX(zend_fetch_var_address_helper, type, BP_VAR_IS);
01062 }
01063 
01064 ZEND_VM_HANDLER(81, ZEND_FETCH_DIM_R, VAR|CV, CONST|TMP|VAR|CV)
01065 {
01066        zend_op *opline = EX(opline);
01067        zend_free_op free_op1, free_op2;
01068        zval *dim = GET_OP2_ZVAL_PTR(BP_VAR_R);
01069        zval **container;
01070 
01071        if (opline->extended_value == ZEND_FETCH_ADD_LOCK &&
01072            OP1_TYPE != IS_CV &&
01073            EX_T(opline->op1.u.var).var.ptr_ptr) {
01074               PZVAL_LOCK(*EX_T(opline->op1.u.var).var.ptr_ptr);
01075        }
01076        container = GET_OP1_ZVAL_PTR_PTR(BP_VAR_R);
01077        if (OP1_TYPE == IS_VAR && !container) {
01078               zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
01079        }
01080        zend_fetch_dimension_address_read(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), container, dim, IS_OP2_TMP_FREE(), BP_VAR_R TSRMLS_CC);
01081        FREE_OP2();
01082        FREE_OP1_VAR_PTR();
01083        ZEND_VM_NEXT_OPCODE();
01084 }
01085 
01086 ZEND_VM_HANDLER(84, ZEND_FETCH_DIM_W, VAR|CV, CONST|TMP|VAR|UNUSED|CV)
01087 {
01088        zend_op *opline = EX(opline);
01089        zend_free_op free_op1, free_op2;
01090        zval *dim = GET_OP2_ZVAL_PTR(BP_VAR_R);
01091        zval **container = GET_OP1_ZVAL_PTR_PTR(BP_VAR_W);
01092 
01093        if (OP1_TYPE == IS_VAR && !container) {
01094               zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
01095        }
01096        zend_fetch_dimension_address(&EX_T(opline->result.u.var), container, dim, IS_OP2_TMP_FREE(), BP_VAR_W TSRMLS_CC);
01097        FREE_OP2();
01098        if (OP1_TYPE == IS_VAR && OP1_FREE &&
01099            READY_TO_DESTROY(free_op1.var)) {
01100               AI_USE_PTR(EX_T(opline->result.u.var).var);
01101               if (!PZVAL_IS_REF(*EX_T(opline->result.u.var).var.ptr_ptr) &&
01102                   Z_REFCOUNT_PP(EX_T(opline->result.u.var).var.ptr_ptr) > 2) {
01103                      SEPARATE_ZVAL(EX_T(opline->result.u.var).var.ptr_ptr);
01104               }
01105        }
01106        FREE_OP1_VAR_PTR();
01107 
01108        /* We are going to assign the result by reference */
01109        if (opline->extended_value && EX_T(opline->result.u.var).var.ptr_ptr) {
01110               Z_DELREF_PP(EX_T(opline->result.u.var).var.ptr_ptr);
01111               SEPARATE_ZVAL_TO_MAKE_IS_REF(EX_T(opline->result.u.var).var.ptr_ptr);
01112               Z_ADDREF_PP(EX_T(opline->result.u.var).var.ptr_ptr);
01113        }
01114 
01115        ZEND_VM_NEXT_OPCODE();
01116 }
01117 
01118 ZEND_VM_HANDLER(87, ZEND_FETCH_DIM_RW, VAR|CV, CONST|TMP|VAR|UNUSED|CV)
01119 {
01120        zend_op *opline = EX(opline);
01121        zend_free_op free_op1, free_op2;
01122        zval *dim = GET_OP2_ZVAL_PTR(BP_VAR_R);
01123        zval **container = GET_OP1_ZVAL_PTR_PTR(BP_VAR_RW);
01124 
01125        if (OP1_TYPE == IS_VAR && !container) {
01126               zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
01127        }
01128        zend_fetch_dimension_address(&EX_T(opline->result.u.var), container, dim, IS_OP2_TMP_FREE(), BP_VAR_RW TSRMLS_CC);
01129        FREE_OP2();
01130        if (OP1_TYPE == IS_VAR && OP1_FREE &&
01131            READY_TO_DESTROY(free_op1.var)) {
01132               AI_USE_PTR(EX_T(opline->result.u.var).var);
01133               if (!PZVAL_IS_REF(*EX_T(opline->result.u.var).var.ptr_ptr) &&
01134                   Z_REFCOUNT_PP(EX_T(opline->result.u.var).var.ptr_ptr) > 2) {
01135                      SEPARATE_ZVAL(EX_T(opline->result.u.var).var.ptr_ptr);
01136               }
01137        }
01138        FREE_OP1_VAR_PTR();
01139        ZEND_VM_NEXT_OPCODE();
01140 }
01141 
01142 ZEND_VM_HANDLER(90, ZEND_FETCH_DIM_IS, VAR|CV, CONST|TMP|VAR|CV)
01143 {
01144        zend_op *opline = EX(opline);
01145        zend_free_op free_op1, free_op2;
01146        zval *dim = GET_OP2_ZVAL_PTR(BP_VAR_R);
01147        zval **container = GET_OP1_ZVAL_PTR_PTR(BP_VAR_IS);
01148 
01149        if (OP1_TYPE == IS_VAR && !container) {
01150               zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
01151        }
01152        zend_fetch_dimension_address_read(&EX_T(opline->result.u.var), container, dim, IS_OP2_TMP_FREE(), BP_VAR_IS TSRMLS_CC);
01153        FREE_OP2();
01154        FREE_OP1_VAR_PTR();
01155        ZEND_VM_NEXT_OPCODE();
01156 }
01157 
01158 ZEND_VM_HANDLER(93, ZEND_FETCH_DIM_FUNC_ARG, VAR|CV, CONST|TMP|VAR|UNUSED|CV)
01159 {
01160        zend_op *opline = EX(opline);
01161        zend_free_op free_op1, free_op2;
01162        zval *dim = GET_OP2_ZVAL_PTR(BP_VAR_R);
01163        zval **container;
01164 
01165        if (ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->extended_value)) {
01166               container = GET_OP1_ZVAL_PTR_PTR(BP_VAR_W);
01167               if (OP1_TYPE == IS_VAR && !container) {
01168                      zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
01169               }
01170               zend_fetch_dimension_address(&EX_T(opline->result.u.var), container, dim, IS_OP2_TMP_FREE(), BP_VAR_W TSRMLS_CC);
01171               if (OP1_TYPE == IS_VAR && OP1_FREE &&
01172                   READY_TO_DESTROY(free_op1.var)) {
01173                      AI_USE_PTR(EX_T(opline->result.u.var).var);
01174                      if (!PZVAL_IS_REF(*EX_T(opline->result.u.var).var.ptr_ptr) &&
01175                          Z_REFCOUNT_PP(EX_T(opline->result.u.var).var.ptr_ptr) > 2) {
01176                             SEPARATE_ZVAL(EX_T(opline->result.u.var).var.ptr_ptr);
01177                      }
01178               }
01179        } else {
01180               if (OP2_TYPE == IS_UNUSED) {
01181                      zend_error_noreturn(E_ERROR, "Cannot use [] for reading");
01182               }
01183               container = GET_OP1_ZVAL_PTR_PTR(BP_VAR_R);
01184               if (OP1_TYPE == IS_VAR && !container) {
01185                      zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
01186               }
01187               zend_fetch_dimension_address_read(&EX_T(opline->result.u.var), container, dim, IS_OP2_TMP_FREE(), BP_VAR_R TSRMLS_CC);
01188        }
01189        FREE_OP2();
01190        FREE_OP1_VAR_PTR();
01191        ZEND_VM_NEXT_OPCODE();
01192 }
01193 
01194 ZEND_VM_HANDLER(96, ZEND_FETCH_DIM_UNSET, VAR|CV, CONST|TMP|VAR|CV)
01195 {
01196        zend_op *opline = EX(opline);
01197        zend_free_op free_op1, free_op2;
01198        zval **container = GET_OP1_ZVAL_PTR_PTR(BP_VAR_UNSET);
01199        zval *dim = GET_OP2_ZVAL_PTR(BP_VAR_R);
01200 
01201        /* Not needed in DIM_UNSET
01202        if (opline->extended_value == ZEND_FETCH_ADD_LOCK) {
01203               PZVAL_LOCK(*EX_T(opline->op1.u.var).var.ptr_ptr);
01204        }
01205        */
01206        if (OP1_TYPE == IS_CV) {
01207               if (container != &EG(uninitialized_zval_ptr)) {
01208                      SEPARATE_ZVAL_IF_NOT_REF(container);
01209               }
01210        }
01211        if (OP1_TYPE == IS_VAR && !container) {
01212               zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
01213        }
01214        zend_fetch_dimension_address(&EX_T(opline->result.u.var), container, dim, IS_OP2_TMP_FREE(), BP_VAR_UNSET TSRMLS_CC);
01215        FREE_OP2();
01216        if (OP1_TYPE == IS_VAR && OP1_FREE &&
01217            READY_TO_DESTROY(free_op1.var)) {
01218               AI_USE_PTR(EX_T(opline->result.u.var).var);
01219               if (!PZVAL_IS_REF(*EX_T(opline->result.u.var).var.ptr_ptr) &&
01220                   Z_REFCOUNT_PP(EX_T(opline->result.u.var).var.ptr_ptr) > 2) {
01221                      SEPARATE_ZVAL(EX_T(opline->result.u.var).var.ptr_ptr);
01222               }
01223        }
01224        FREE_OP1_VAR_PTR();
01225        if (EX_T(opline->result.u.var).var.ptr_ptr == NULL) {
01226               zend_error_noreturn(E_ERROR, "Cannot unset string offsets");
01227        } else {
01228               zend_free_op free_res;
01229 
01230               PZVAL_UNLOCK(*EX_T(opline->result.u.var).var.ptr_ptr, &free_res);
01231               if (EX_T(opline->result.u.var).var.ptr_ptr != &EG(uninitialized_zval_ptr)) {
01232                      SEPARATE_ZVAL_IF_NOT_REF(EX_T(opline->result.u.var).var.ptr_ptr);
01233               }
01234               PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr);
01235               FREE_OP_VAR_PTR(free_res);
01236        }
01237        ZEND_VM_NEXT_OPCODE();
01238 }
01239 
01240 ZEND_VM_HELPER_EX(zend_fetch_property_address_read_helper, VAR|UNUSED|CV, CONST|TMP|VAR|CV, int type)
01241 {
01242        zend_op *opline = EX(opline);
01243        zend_free_op free_op1;
01244        zval *container = GET_OP1_OBJ_ZVAL_PTR(type);
01245        zend_free_op free_op2;
01246        zval *offset  = GET_OP2_ZVAL_PTR(BP_VAR_R);
01247 
01248        if (Z_TYPE_P(container) != IS_OBJECT || !Z_OBJ_HT_P(container)->read_property) {
01249               if (type != BP_VAR_IS) {
01250                      zend_error(E_NOTICE, "Trying to get property of non-object");
01251               }
01252               if (!RETURN_VALUE_UNUSED(&opline->result)) {
01253                      AI_SET_PTR(EX_T(opline->result.u.var).var, EG(uninitialized_zval_ptr));
01254                      PZVAL_LOCK(EG(uninitialized_zval_ptr));
01255               }
01256               FREE_OP2();
01257        } else {
01258               zval *retval;
01259 
01260               if (IS_OP2_TMP_FREE()) {
01261                      MAKE_REAL_ZVAL_PTR(offset);
01262               }
01263 
01264               /* here we are sure we are dealing with an object */
01265               retval = Z_OBJ_HT_P(container)->read_property(container, offset, type TSRMLS_CC);
01266 
01267               if (RETURN_VALUE_UNUSED(&opline->result)) {
01268                      if (Z_REFCOUNT_P(retval) == 0) {
01269                             GC_REMOVE_ZVAL_FROM_BUFFER(retval);
01270                             zval_dtor(retval);
01271                             FREE_ZVAL(retval);
01272                      }
01273               } else {
01274                      AI_SET_PTR(EX_T(opline->result.u.var).var, retval);
01275                      PZVAL_LOCK(retval);
01276               }
01277 
01278               if (IS_OP2_TMP_FREE()) {
01279                      zval_ptr_dtor(&offset);
01280               } else {
01281                      FREE_OP2();
01282               }
01283        }
01284 
01285        FREE_OP1();
01286        ZEND_VM_NEXT_OPCODE();
01287 }
01288 
01289 ZEND_VM_HANDLER(82, ZEND_FETCH_OBJ_R, VAR|UNUSED|CV, CONST|TMP|VAR|CV)
01290 {
01291        ZEND_VM_DISPATCH_TO_HELPER_EX(zend_fetch_property_address_read_helper, type, BP_VAR_R);
01292 }
01293 
01294 ZEND_VM_HANDLER(85, ZEND_FETCH_OBJ_W, VAR|UNUSED|CV, CONST|TMP|VAR|CV)
01295 {
01296        zend_op *opline = EX(opline);
01297        zend_free_op free_op1, free_op2;
01298        zval *property = GET_OP2_ZVAL_PTR(BP_VAR_R);
01299        zval **container;
01300 
01301        if (OP1_TYPE == IS_VAR && (opline->extended_value & ZEND_FETCH_ADD_LOCK)) {
01302               PZVAL_LOCK(*EX_T(opline->op1.u.var).var.ptr_ptr);
01303               EX_T(opline->op1.u.var).var.ptr = *EX_T(opline->op1.u.var).var.ptr_ptr;
01304        }
01305 
01306        if (IS_OP2_TMP_FREE()) {
01307               MAKE_REAL_ZVAL_PTR(property);
01308        }
01309        container = GET_OP1_OBJ_ZVAL_PTR_PTR(BP_VAR_W);
01310        if (OP1_TYPE == IS_VAR && !container) {
01311               zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
01312        }
01313        zend_fetch_property_address(&EX_T(opline->result.u.var), container, property, BP_VAR_W TSRMLS_CC);
01314        if (IS_OP2_TMP_FREE()) {
01315               zval_ptr_dtor(&property);
01316        } else {
01317               FREE_OP2();
01318        }
01319        if (OP1_TYPE == IS_VAR && OP1_FREE &&
01320            READY_TO_DESTROY(free_op1.var)) {
01321               AI_USE_PTR(EX_T(opline->result.u.var).var);
01322               if (!PZVAL_IS_REF(*EX_T(opline->result.u.var).var.ptr_ptr) &&
01323                   Z_REFCOUNT_PP(EX_T(opline->result.u.var).var.ptr_ptr) > 2) {
01324                      SEPARATE_ZVAL(EX_T(opline->result.u.var).var.ptr_ptr);
01325               }
01326        }
01327        FREE_OP1_VAR_PTR();
01328 
01329        /* We are going to assign the result by reference */
01330        if (opline->extended_value & ZEND_FETCH_MAKE_REF) {
01331               Z_DELREF_PP(EX_T(opline->result.u.var).var.ptr_ptr);
01332               SEPARATE_ZVAL_TO_MAKE_IS_REF(EX_T(opline->result.u.var).var.ptr_ptr);
01333               Z_ADDREF_PP(EX_T(opline->result.u.var).var.ptr_ptr);
01334        }
01335        
01336        ZEND_VM_NEXT_OPCODE();
01337 }
01338 
01339 ZEND_VM_HANDLER(88, ZEND_FETCH_OBJ_RW, VAR|UNUSED|CV, CONST|TMP|VAR|CV)
01340 {
01341        zend_op *opline = EX(opline);
01342        zend_free_op free_op1, free_op2;
01343        zval *property = GET_OP2_ZVAL_PTR(BP_VAR_R);
01344        zval **container = GET_OP1_OBJ_ZVAL_PTR_PTR(BP_VAR_RW);
01345 
01346        if (IS_OP2_TMP_FREE()) {
01347               MAKE_REAL_ZVAL_PTR(property);
01348        }
01349        if (OP1_TYPE == IS_VAR && !container) {
01350               zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
01351        }
01352        zend_fetch_property_address(&EX_T(opline->result.u.var), container, property, BP_VAR_RW TSRMLS_CC);
01353        if (IS_OP2_TMP_FREE()) {
01354               zval_ptr_dtor(&property);
01355        } else {
01356               FREE_OP2();
01357        }
01358        if (OP1_TYPE == IS_VAR && OP1_FREE &&
01359            READY_TO_DESTROY(free_op1.var)) {
01360               AI_USE_PTR(EX_T(opline->result.u.var).var);
01361               if (!PZVAL_IS_REF(*EX_T(opline->result.u.var).var.ptr_ptr) &&
01362                   Z_REFCOUNT_PP(EX_T(opline->result.u.var).var.ptr_ptr) > 2) {
01363                      SEPARATE_ZVAL(EX_T(opline->result.u.var).var.ptr_ptr);
01364               }
01365        }
01366        FREE_OP1_VAR_PTR();
01367        ZEND_VM_NEXT_OPCODE();
01368 }
01369 
01370 ZEND_VM_HANDLER(91, ZEND_FETCH_OBJ_IS, VAR|UNUSED|CV, CONST|TMP|VAR|CV)
01371 {
01372        ZEND_VM_DISPATCH_TO_HELPER_EX(zend_fetch_property_address_read_helper, type, BP_VAR_IS);
01373 }
01374 
01375 ZEND_VM_HANDLER(94, ZEND_FETCH_OBJ_FUNC_ARG, VAR|UNUSED|CV, CONST|TMP|VAR|CV)
01376 {
01377        zend_op *opline = EX(opline);
01378 
01379        if (ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->extended_value)) {
01380               /* Behave like FETCH_OBJ_W */
01381               zend_free_op free_op1, free_op2;
01382               zval *property = GET_OP2_ZVAL_PTR(BP_VAR_R);
01383               zval **container = GET_OP1_OBJ_ZVAL_PTR_PTR(BP_VAR_W);
01384 
01385               if (IS_OP2_TMP_FREE()) {
01386                      MAKE_REAL_ZVAL_PTR(property);
01387               }
01388               if (OP1_TYPE == IS_VAR && !container) {
01389                      zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
01390               }
01391               zend_fetch_property_address(&EX_T(opline->result.u.var), container, property, BP_VAR_W TSRMLS_CC);
01392               if (IS_OP2_TMP_FREE()) {
01393                      zval_ptr_dtor(&property);
01394               } else {
01395                      FREE_OP2();
01396               }
01397               if (OP1_TYPE == IS_VAR && OP1_FREE &&
01398                   READY_TO_DESTROY(free_op1.var)) {
01399                      AI_USE_PTR(EX_T(opline->result.u.var).var);
01400                      if (!PZVAL_IS_REF(*EX_T(opline->result.u.var).var.ptr_ptr) &&
01401                          Z_REFCOUNT_PP(EX_T(opline->result.u.var).var.ptr_ptr) > 2) {
01402                             SEPARATE_ZVAL(EX_T(opline->result.u.var).var.ptr_ptr);
01403                      }
01404               }
01405               FREE_OP1_VAR_PTR();
01406               ZEND_VM_NEXT_OPCODE();
01407        } else {
01408               ZEND_VM_DISPATCH_TO_HELPER_EX(zend_fetch_property_address_read_helper, type, BP_VAR_R);
01409        }
01410 }
01411 
01412 ZEND_VM_HANDLER(97, ZEND_FETCH_OBJ_UNSET, VAR|UNUSED|CV, CONST|TMP|VAR|CV)
01413 {
01414        zend_op *opline = EX(opline);
01415        zend_free_op free_op1, free_op2, free_res;
01416        zval **container = GET_OP1_OBJ_ZVAL_PTR_PTR(BP_VAR_R);
01417        zval *property = GET_OP2_ZVAL_PTR(BP_VAR_R);
01418 
01419        if (OP1_TYPE == IS_CV) {
01420               if (container != &EG(uninitialized_zval_ptr)) {
01421                      SEPARATE_ZVAL_IF_NOT_REF(container);
01422               }
01423        }
01424        if (IS_OP2_TMP_FREE()) {
01425               MAKE_REAL_ZVAL_PTR(property);
01426        }
01427        if (OP1_TYPE == IS_VAR && !container) {
01428               zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
01429        }
01430        zend_fetch_property_address(&EX_T(opline->result.u.var), container, property, BP_VAR_UNSET TSRMLS_CC);
01431        if (IS_OP2_TMP_FREE()) {
01432               zval_ptr_dtor(&property);
01433        } else {
01434               FREE_OP2();
01435        }
01436        if (OP1_TYPE == IS_VAR && OP1_FREE &&
01437            READY_TO_DESTROY(free_op1.var)) {
01438               AI_USE_PTR(EX_T(opline->result.u.var).var);
01439               if (!PZVAL_IS_REF(*EX_T(opline->result.u.var).var.ptr_ptr) &&
01440                   Z_REFCOUNT_PP(EX_T(opline->result.u.var).var.ptr_ptr) > 2) {
01441                      SEPARATE_ZVAL(EX_T(opline->result.u.var).var.ptr_ptr);
01442               }
01443        }
01444        FREE_OP1_VAR_PTR();
01445 
01446        PZVAL_UNLOCK(*EX_T(opline->result.u.var).var.ptr_ptr, &free_res);
01447        if (EX_T(opline->result.u.var).var.ptr_ptr != &EG(uninitialized_zval_ptr)) {
01448               SEPARATE_ZVAL_IF_NOT_REF(EX_T(opline->result.u.var).var.ptr_ptr);
01449        }
01450        PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr);
01451        FREE_OP_VAR_PTR(free_res);
01452        ZEND_VM_NEXT_OPCODE();
01453 }
01454 
01455 ZEND_VM_HANDLER(98, ZEND_FETCH_DIM_TMP_VAR, CONST|TMP, CONST)
01456 {
01457        zend_op *opline = EX(opline);
01458        zend_free_op free_op1;
01459        zval *container = GET_OP1_ZVAL_PTR(BP_VAR_R);
01460 
01461        if (Z_TYPE_P(container) != IS_ARRAY) {
01462               if (!RETURN_VALUE_UNUSED(&opline->result)) {
01463                      AI_SET_PTR(EX_T(opline->result.u.var).var, EG(uninitialized_zval_ptr));
01464                      PZVAL_LOCK(EG(uninitialized_zval_ptr));
01465               }
01466        } else {
01467               zend_free_op free_op2;
01468               zval *dim = GET_OP2_ZVAL_PTR(BP_VAR_R);
01469 
01470               AI_SET_PTR(EX_T(opline->result.u.var).var, *zend_fetch_dimension_address_inner(Z_ARRVAL_P(container), dim, BP_VAR_R TSRMLS_CC));
01471               SELECTIVE_PZVAL_LOCK(EX_T(opline->result.u.var).var.ptr, &opline->result);
01472               FREE_OP2();
01473        }
01474        ZEND_VM_NEXT_OPCODE();
01475 }
01476 
01477 ZEND_VM_HANDLER(136, ZEND_ASSIGN_OBJ, VAR|UNUSED|CV, CONST|TMP|VAR|CV)
01478 {
01479        zend_op *opline = EX(opline);
01480        zend_op *op_data = opline+1;
01481        zend_free_op free_op1, free_op2;
01482        zval **object_ptr = GET_OP1_OBJ_ZVAL_PTR_PTR(BP_VAR_W);
01483        zval *property_name = GET_OP2_ZVAL_PTR(BP_VAR_R);
01484 
01485        if (IS_OP2_TMP_FREE()) {
01486               MAKE_REAL_ZVAL_PTR(property_name);
01487        }
01488        if (OP1_TYPE == IS_VAR && !object_ptr) {
01489               zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
01490        }
01491        zend_assign_to_object(&opline->result, object_ptr, property_name, &op_data->op1, EX(Ts), ZEND_ASSIGN_OBJ TSRMLS_CC);
01492        if (IS_OP2_TMP_FREE()) {
01493               zval_ptr_dtor(&property_name);
01494        } else {
01495               FREE_OP2();
01496        }
01497        FREE_OP1_VAR_PTR();
01498        /* assign_obj has two opcodes! */
01499        ZEND_VM_INC_OPCODE();
01500        ZEND_VM_NEXT_OPCODE();
01501 }
01502 
01503 ZEND_VM_HANDLER(147, ZEND_ASSIGN_DIM, VAR|CV, CONST|TMP|VAR|UNUSED|CV)
01504 {
01505        zend_op *opline = EX(opline);
01506        zend_op *op_data = opline+1;
01507        zend_free_op free_op1;
01508        zval **object_ptr = GET_OP1_ZVAL_PTR_PTR(BP_VAR_W);
01509 
01510        if (OP1_TYPE == IS_VAR && !object_ptr) {
01511               zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
01512        }
01513        if (Z_TYPE_PP(object_ptr) == IS_OBJECT) {
01514               zend_free_op free_op2;
01515               zval *property_name = GET_OP2_ZVAL_PTR(BP_VAR_R);
01516 
01517               if (IS_OP2_TMP_FREE()) {
01518                      MAKE_REAL_ZVAL_PTR(property_name);
01519               }
01520               zend_assign_to_object(&opline->result, object_ptr, property_name, &op_data->op1, EX(Ts), ZEND_ASSIGN_DIM TSRMLS_CC);
01521               if (IS_OP2_TMP_FREE()) {
01522                      zval_ptr_dtor(&property_name);
01523               } else {
01524                      FREE_OP2();
01525               }
01526        } else {
01527               zend_free_op free_op2, free_op_data1, free_op_data2;
01528               zval *value;
01529               zval *dim = GET_OP2_ZVAL_PTR(BP_VAR_R);
01530               zval **variable_ptr_ptr;
01531 
01532               zend_fetch_dimension_address(&EX_T(op_data->op2.u.var), object_ptr, dim, IS_OP2_TMP_FREE(), BP_VAR_W TSRMLS_CC);
01533               FREE_OP2();
01534 
01535               value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R);
01536               variable_ptr_ptr = _get_zval_ptr_ptr_var(&op_data->op2, EX(Ts), &free_op_data2 TSRMLS_CC);
01537               if (!variable_ptr_ptr) {
01538                      if (zend_assign_to_string_offset(&EX_T(op_data->op2.u.var), value, op_data->op1.op_type TSRMLS_CC)) {
01539                             if (!RETURN_VALUE_UNUSED(&opline->result)) {
01540                                    EX_T(opline->result.u.var).var.ptr_ptr = &EX_T(opline->result.u.var).var.ptr;
01541                                    ALLOC_ZVAL(EX_T(opline->result.u.var).var.ptr);
01542                                    INIT_PZVAL(EX_T(opline->result.u.var).var.ptr);
01543                                    ZVAL_STRINGL(EX_T(opline->result.u.var).var.ptr, Z_STRVAL_P(EX_T(op_data->op2.u.var).str_offset.str)+EX_T(op_data->op2.u.var).str_offset.offset, 1, 1);
01544                             }
01545                      } else if (!RETURN_VALUE_UNUSED(&opline->result)) {
01546                             AI_SET_PTR(EX_T(opline->result.u.var).var, EG(uninitialized_zval_ptr));
01547                             PZVAL_LOCK(EG(uninitialized_zval_ptr));
01548                      }
01549               } else {
01550                      value = zend_assign_to_variable(variable_ptr_ptr, value, IS_TMP_FREE(free_op_data1) TSRMLS_CC);
01551                      if (!RETURN_VALUE_UNUSED(&opline->result)) {
01552                             AI_SET_PTR(EX_T(opline->result.u.var).var, value);
01553                             PZVAL_LOCK(value);
01554                      }
01555               }
01556               FREE_OP_VAR_PTR(free_op_data2);
01557               FREE_OP_IF_VAR(free_op_data1);
01558        }
01559        FREE_OP1_VAR_PTR();
01560        /* assign_dim has two opcodes! */
01561        ZEND_VM_INC_OPCODE();
01562        ZEND_VM_NEXT_OPCODE();
01563 }
01564 
01565 ZEND_VM_HANDLER(38, ZEND_ASSIGN, VAR|CV, CONST|TMP|VAR|CV)
01566 {
01567        zend_op *opline = EX(opline);
01568        zend_free_op free_op1, free_op2;
01569        zval *value = GET_OP2_ZVAL_PTR(BP_VAR_R);
01570        zval **variable_ptr_ptr = GET_OP1_ZVAL_PTR_PTR(BP_VAR_W);
01571 
01572        if (OP1_TYPE == IS_VAR && !variable_ptr_ptr) {
01573               if (zend_assign_to_string_offset(&EX_T(opline->op1.u.var), value, OP2_TYPE TSRMLS_CC)) {
01574                      if (!RETURN_VALUE_UNUSED(&opline->result)) {
01575                             EX_T(opline->result.u.var).var.ptr_ptr = &EX_T(opline->result.u.var).var.ptr;
01576                             ALLOC_ZVAL(EX_T(opline->result.u.var).var.ptr);
01577                             INIT_PZVAL(EX_T(opline->result.u.var).var.ptr);
01578                             ZVAL_STRINGL(EX_T(opline->result.u.var).var.ptr, Z_STRVAL_P(EX_T(opline->op1.u.var).str_offset.str)+EX_T(opline->op1.u.var).str_offset.offset, 1, 1);
01579                      }
01580               } else if (!RETURN_VALUE_UNUSED(&opline->result)) {
01581                      AI_SET_PTR(EX_T(opline->result.u.var).var, EG(uninitialized_zval_ptr));
01582                      PZVAL_LOCK(EG(uninitialized_zval_ptr));
01583               }
01584        } else {
01585               value = zend_assign_to_variable(variable_ptr_ptr, value, IS_OP2_TMP_FREE() TSRMLS_CC);
01586               if (!RETURN_VALUE_UNUSED(&opline->result)) {
01587                      AI_SET_PTR(EX_T(opline->result.u.var).var, value);
01588                      PZVAL_LOCK(value);
01589               }
01590        }
01591 
01592        FREE_OP1_VAR_PTR();
01593 
01594        /* zend_assign_to_variable() always takes care of op2, never free it! */
01595        FREE_OP2_IF_VAR();
01596 
01597        ZEND_VM_NEXT_OPCODE();
01598 }
01599 
01600 ZEND_VM_HANDLER(39, ZEND_ASSIGN_REF, VAR|CV, VAR|CV)
01601 {
01602        zend_op *opline = EX(opline);
01603        zend_free_op free_op1, free_op2;
01604        zval **variable_ptr_ptr;
01605        zval **value_ptr_ptr = GET_OP2_ZVAL_PTR_PTR(BP_VAR_W);
01606 
01607        if (OP2_TYPE == IS_VAR &&
01608            value_ptr_ptr &&
01609            !Z_ISREF_PP(value_ptr_ptr) &&
01610            opline->extended_value == ZEND_RETURNS_FUNCTION &&
01611            !EX_T(opline->op2.u.var).var.fcall_returned_reference) {
01612               if (free_op2.var == NULL) {
01613                      PZVAL_LOCK(*value_ptr_ptr); /* undo the effect of get_zval_ptr_ptr() */
01614               }
01615               zend_error(E_STRICT, "Only variables should be assigned by reference");
01616               if (UNEXPECTED(EG(exception) != NULL)) {
01617                      FREE_OP2_VAR_PTR();
01618                      ZEND_VM_NEXT_OPCODE();
01619               }
01620               ZEND_VM_DISPATCH_TO_HANDLER(ZEND_ASSIGN);
01621        } else if (OP2_TYPE == IS_VAR && opline->extended_value == ZEND_RETURNS_NEW) {
01622               PZVAL_LOCK(*value_ptr_ptr);
01623        }
01624        if (OP1_TYPE == IS_VAR && EX_T(opline->op1.u.var).var.ptr_ptr == &EX_T(opline->op1.u.var).var.ptr) {
01625               zend_error_noreturn(E_ERROR, "Cannot assign by reference to overloaded object");
01626        }
01627 
01628        variable_ptr_ptr = GET_OP1_ZVAL_PTR_PTR(BP_VAR_W);
01629        if ((OP2_TYPE == IS_VAR && !value_ptr_ptr) ||
01630            (OP1_TYPE == IS_VAR && !variable_ptr_ptr)) {
01631               zend_error_noreturn(E_ERROR, "Cannot create references to/from string offsets nor overloaded objects");
01632        }
01633        zend_assign_to_variable_reference(variable_ptr_ptr, value_ptr_ptr TSRMLS_CC);
01634 
01635        if (OP2_TYPE == IS_VAR && opline->extended_value == ZEND_RETURNS_NEW) {
01636               Z_DELREF_PP(variable_ptr_ptr);
01637        }
01638 
01639        if (!RETURN_VALUE_UNUSED(&opline->result)) {
01640               AI_SET_PTR(EX_T(opline->result.u.var).var, *variable_ptr_ptr);
01641               PZVAL_LOCK(*variable_ptr_ptr);
01642        }
01643 
01644        FREE_OP1_VAR_PTR();
01645        FREE_OP2_VAR_PTR();
01646 
01647        ZEND_VM_NEXT_OPCODE();
01648 }
01649 
01650 ZEND_VM_HANDLER(42, ZEND_JMP, ANY, ANY)
01651 {
01652 #if DEBUG_ZEND>=2
01653        printf("Jumping to %d\n", EX(opline)->op1.u.opline_num);
01654 #endif
01655        ZEND_VM_SET_OPCODE(EX(opline)->op1.u.jmp_addr);
01656        ZEND_VM_CONTINUE(); /* CHECK_ME */
01657 }
01658 
01659 ZEND_VM_HANDLER(43, ZEND_JMPZ, CONST|TMP|VAR|CV, ANY)
01660 {
01661        zend_op *opline = EX(opline);
01662        zend_free_op free_op1;
01663        zval *val = GET_OP1_ZVAL_PTR(BP_VAR_R);
01664        int ret;
01665 
01666        if (OP1_TYPE == IS_TMP_VAR && Z_TYPE_P(val) == IS_BOOL) {
01667               ret = Z_LVAL_P(val);
01668        } else {
01669               ret = i_zend_is_true(val);
01670               FREE_OP1();
01671               if (UNEXPECTED(EG(exception) != NULL)) {
01672                      ZEND_VM_CONTINUE();
01673               }
01674        }
01675        if (!ret) {
01676 #if DEBUG_ZEND>=2
01677               printf("Conditional jmp to %d\n", opline->op2.u.opline_num);
01678 #endif
01679               ZEND_VM_SET_OPCODE(opline->op2.u.jmp_addr);
01680               ZEND_VM_CONTINUE();
01681        }
01682 
01683        ZEND_VM_NEXT_OPCODE();
01684 }
01685 
01686 ZEND_VM_HANDLER(44, ZEND_JMPNZ, CONST|TMP|VAR|CV, ANY)
01687 {
01688        zend_op *opline = EX(opline);
01689        zend_free_op free_op1;
01690        zval *val = GET_OP1_ZVAL_PTR(BP_VAR_R);
01691        int ret;
01692 
01693        if (OP1_TYPE == IS_TMP_VAR && Z_TYPE_P(val) == IS_BOOL) {
01694               ret = Z_LVAL_P(val);
01695        } else {
01696               ret = i_zend_is_true(val);
01697               FREE_OP1();
01698               if (UNEXPECTED(EG(exception) != NULL)) {
01699                      ZEND_VM_CONTINUE();
01700               }
01701        }
01702        if (ret) {
01703 #if DEBUG_ZEND>=2
01704               printf("Conditional jmp to %d\n", opline->op2.u.opline_num);
01705 #endif
01706               ZEND_VM_SET_OPCODE(opline->op2.u.jmp_addr);
01707               ZEND_VM_CONTINUE();
01708        }
01709 
01710        ZEND_VM_NEXT_OPCODE();
01711 }
01712 
01713 ZEND_VM_HANDLER(45, ZEND_JMPZNZ, CONST|TMP|VAR|CV, ANY)
01714 {
01715        zend_op *opline = EX(opline);
01716        zend_free_op free_op1;
01717        zval *val = GET_OP1_ZVAL_PTR(BP_VAR_R);
01718        int retval;
01719 
01720        if (OP1_TYPE == IS_TMP_VAR && Z_TYPE_P(val) == IS_BOOL) {
01721               retval = Z_LVAL_P(val);
01722        } else {
01723               retval = i_zend_is_true(val);
01724               FREE_OP1();
01725               if (UNEXPECTED(EG(exception) != NULL)) {
01726                      ZEND_VM_CONTINUE();
01727               }
01728        }
01729        if (EXPECTED(retval != 0)) {
01730 #if DEBUG_ZEND>=2
01731               printf("Conditional jmp on true to %d\n", opline->extended_value);
01732 #endif
01733               ZEND_VM_SET_OPCODE(&EX(op_array)->opcodes[opline->extended_value]);
01734               ZEND_VM_CONTINUE(); /* CHECK_ME */
01735        } else {
01736 #if DEBUG_ZEND>=2
01737               printf("Conditional jmp on false to %d\n", opline->op2.u.opline_num);
01738 #endif
01739               ZEND_VM_SET_OPCODE(&EX(op_array)->opcodes[opline->op2.u.opline_num]);
01740               ZEND_VM_CONTINUE(); /* CHECK_ME */
01741        }
01742 }
01743 
01744 ZEND_VM_HANDLER(46, ZEND_JMPZ_EX, CONST|TMP|VAR|CV, ANY)
01745 {
01746        zend_op *opline = EX(opline);
01747        zend_free_op free_op1;
01748        zval *val = GET_OP1_ZVAL_PTR(BP_VAR_R);
01749        int retval;
01750 
01751        if (OP1_TYPE == IS_TMP_VAR && Z_TYPE_P(val) == IS_BOOL) {
01752               retval = Z_LVAL_P(val);
01753        } else {
01754               retval = i_zend_is_true(val);
01755               FREE_OP1();
01756               if (UNEXPECTED(EG(exception) != NULL)) {
01757                      ZEND_VM_CONTINUE();
01758               }
01759        }
01760        Z_LVAL(EX_T(opline->result.u.var).tmp_var) = retval;
01761        Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_BOOL;
01762        if (!retval) {
01763 #if DEBUG_ZEND>=2
01764               printf("Conditional jmp to %d\n", opline->op2.u.opline_num);
01765 #endif
01766               ZEND_VM_SET_OPCODE(opline->op2.u.jmp_addr);
01767               ZEND_VM_CONTINUE();
01768        }
01769        ZEND_VM_NEXT_OPCODE();
01770 }
01771 
01772 ZEND_VM_HANDLER(47, ZEND_JMPNZ_EX, CONST|TMP|VAR|CV, ANY)
01773 {
01774        zend_op *opline = EX(opline);
01775        zend_free_op free_op1;
01776        zval *val = GET_OP1_ZVAL_PTR(BP_VAR_R);
01777        int retval;
01778 
01779        if (OP1_TYPE == IS_TMP_VAR && Z_TYPE_P(val) == IS_BOOL) {
01780               retval = Z_LVAL_P(val);
01781        } else {
01782               retval = i_zend_is_true(val);
01783               FREE_OP1();
01784               if (UNEXPECTED(EG(exception) != NULL)) {
01785                      ZEND_VM_CONTINUE();
01786               }
01787        }
01788        Z_LVAL(EX_T(opline->result.u.var).tmp_var) = retval;
01789        Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_BOOL;
01790        if (retval) {
01791 #if DEBUG_ZEND>=2
01792               printf("Conditional jmp to %d\n", opline->op2.u.opline_num);
01793 #endif
01794               ZEND_VM_SET_OPCODE(opline->op2.u.jmp_addr);
01795               ZEND_VM_CONTINUE();
01796        }
01797        ZEND_VM_NEXT_OPCODE();
01798 }
01799 
01800 ZEND_VM_HANDLER(70, ZEND_FREE, TMP, ANY)
01801 {
01802        zendi_zval_dtor(EX_T(EX(opline)->op1.u.var).tmp_var);
01803        ZEND_VM_NEXT_OPCODE();
01804 }
01805 
01806 ZEND_VM_HANDLER(53, ZEND_INIT_STRING, ANY, ANY)
01807 {
01808        zval *tmp = &EX_T(EX(opline)->result.u.var).tmp_var;
01809 
01810        tmp->value.str.val = emalloc(1);
01811        tmp->value.str.val[0] = 0;
01812        tmp->value.str.len = 0;
01813        Z_SET_REFCOUNT_P(tmp, 1);
01814        tmp->type = IS_STRING;
01815        Z_UNSET_ISREF_P(tmp);
01816        ZEND_VM_NEXT_OPCODE();
01817 }
01818 
01819 ZEND_VM_HANDLER(54, ZEND_ADD_CHAR, TMP|UNUSED, CONST)
01820 {
01821        zend_op *opline = EX(opline);
01822        zval *str = &EX_T(opline->result.u.var).tmp_var;
01823 
01824        if (OP1_TYPE == IS_UNUSED) {
01825               /* Initialize for erealloc in add_char_to_string */
01826               Z_STRVAL_P(str) = NULL;
01827               Z_STRLEN_P(str) = 0;
01828               Z_TYPE_P(str) = IS_STRING;
01829 
01830               INIT_PZVAL(str);
01831        }
01832 
01833        add_char_to_string(str, str, &opline->op2.u.constant);
01834 
01835        /* FREE_OP is missing intentionally here - we're always working on the same temporary variable */
01836        ZEND_VM_NEXT_OPCODE();
01837 }
01838 
01839 ZEND_VM_HANDLER(55, ZEND_ADD_STRING, TMP|UNUSED, CONST)
01840 {
01841        zend_op *opline = EX(opline);
01842        zval *str = &EX_T(opline->result.u.var).tmp_var;
01843 
01844        if (OP1_TYPE == IS_UNUSED) {
01845               /* Initialize for erealloc in add_string_to_string */
01846               Z_STRVAL_P(str) = NULL;
01847               Z_STRLEN_P(str) = 0;
01848               Z_TYPE_P(str) = IS_STRING;
01849 
01850               INIT_PZVAL(str);
01851        }
01852 
01853        add_string_to_string(str, str, &opline->op2.u.constant);
01854 
01855        /* FREE_OP is missing intentionally here - we're always working on the same temporary variable */
01856        ZEND_VM_NEXT_OPCODE();
01857 }
01858 
01859 ZEND_VM_HANDLER(56, ZEND_ADD_VAR, TMP|UNUSED, TMP|VAR|CV)
01860 {
01861        zend_op *opline = EX(opline);
01862        zend_free_op free_op2;
01863        zval *str = &EX_T(opline->result.u.var).tmp_var;
01864        zval *var = GET_OP2_ZVAL_PTR(BP_VAR_R);
01865        zval var_copy;
01866        int use_copy = 0;
01867 
01868        if (OP1_TYPE == IS_UNUSED) {
01869               /* Initialize for erealloc in add_string_to_string */
01870               Z_STRVAL_P(str) = NULL;
01871               Z_STRLEN_P(str) = 0;
01872               Z_TYPE_P(str) = IS_STRING;
01873 
01874               INIT_PZVAL(str);
01875        }
01876 
01877        if (Z_TYPE_P(var) != IS_STRING) {
01878               zend_make_printable_zval(var, &var_copy, &use_copy);
01879 
01880               if (use_copy) {
01881                      var = &var_copy;
01882               }
01883        }
01884        add_string_to_string(str, str, var);
01885 
01886        if (use_copy) {
01887               zval_dtor(var);
01888        }
01889        /* original comment, possibly problematic:
01890         * FREE_OP is missing intentionally here - we're always working on the same temporary variable
01891         * (Zeev):  I don't think it's problematic, we only use variables
01892         * which aren't affected by FREE_OP(Ts, )'s anyway, unless they're
01893         * string offsets or overloaded objects
01894         */
01895        FREE_OP2();
01896 
01897        ZEND_VM_NEXT_OPCODE();
01898 }
01899 
01900 ZEND_VM_HANDLER(109, ZEND_FETCH_CLASS, ANY, CONST|TMP|VAR|UNUSED|CV)
01901 {
01902        zend_op *opline = EX(opline);
01903 
01904 
01905        if (OP2_TYPE == IS_UNUSED) {
01906               EX_T(opline->result.u.var).class_entry = zend_fetch_class(NULL, 0, opline->extended_value TSRMLS_CC);
01907               ZEND_VM_NEXT_OPCODE();
01908        } else {
01909               zend_free_op free_op2;
01910               zval *class_name = GET_OP2_ZVAL_PTR(BP_VAR_R);
01911 
01912               if (OP2_TYPE != IS_CONST && Z_TYPE_P(class_name) == IS_OBJECT) {
01913                      EX_T(opline->result.u.var).class_entry = Z_OBJCE_P(class_name);
01914               } else if (Z_TYPE_P(class_name) == IS_STRING) {
01915                      EX_T(opline->result.u.var).class_entry = zend_fetch_class(Z_STRVAL_P(class_name), Z_STRLEN_P(class_name), opline->extended_value TSRMLS_CC);
01916               } else {
01917                      zend_error_noreturn(E_ERROR, "Class name must be a valid object or a string");
01918               }
01919 
01920               FREE_OP2();
01921               ZEND_VM_NEXT_OPCODE();
01922        }
01923 }
01924 
01925 ZEND_VM_HANDLER(112, ZEND_INIT_METHOD_CALL, TMP|VAR|UNUSED|CV, CONST|TMP|VAR|CV)
01926 {
01927        zend_op *opline = EX(opline);
01928        zval *function_name;
01929        char *function_name_strval;
01930        int function_name_strlen;
01931        zend_free_op free_op1, free_op2;
01932 
01933        zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), EX(called_scope));
01934 
01935        function_name = GET_OP2_ZVAL_PTR(BP_VAR_R);
01936 
01937        if (Z_TYPE_P(function_name)!=IS_STRING) {
01938               zend_error_noreturn(E_ERROR, "Method name must be a string");
01939        }
01940 
01941        function_name_strval = Z_STRVAL_P(function_name);
01942        function_name_strlen = Z_STRLEN_P(function_name);
01943 
01944        EX(object) = GET_OP1_OBJ_ZVAL_PTR(BP_VAR_R);
01945 
01946        if (EX(object) && Z_TYPE_P(EX(object)) == IS_OBJECT) {
01947               if (Z_OBJ_HT_P(EX(object))->get_method == NULL) {
01948                      zend_error_noreturn(E_ERROR, "Object does not support method calls");
01949               }
01950 
01951               /* First, locate the function. */
01952               EX(fbc) = Z_OBJ_HT_P(EX(object))->get_method(&EX(object), function_name_strval, function_name_strlen TSRMLS_CC);
01953               if (!EX(fbc)) {
01954                      zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(EX(object)), function_name_strval);
01955               }
01956               
01957               EX(called_scope) = Z_OBJCE_P(EX(object));
01958        } else {
01959               zend_error_noreturn(E_ERROR, "Call to a member function %s() on a non-object", function_name_strval);
01960        }
01961        
01962        if ((EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) != 0) {
01963               EX(object) = NULL;
01964        } else {             
01965               if (!PZVAL_IS_REF(EX(object))) {
01966                      Z_ADDREF_P(EX(object)); /* For $this pointer */
01967               } else {
01968                      zval *this_ptr;
01969                      ALLOC_ZVAL(this_ptr);
01970                      INIT_PZVAL_COPY(this_ptr, EX(object));
01971                      zval_copy_ctor(this_ptr);
01972                      EX(object) = this_ptr;
01973               }
01974        }
01975 
01976        FREE_OP2();
01977        FREE_OP1_IF_VAR();
01978 
01979        ZEND_VM_NEXT_OPCODE();
01980 }
01981 
01982 ZEND_VM_HANDLER(113, ZEND_INIT_STATIC_METHOD_CALL, CONST|VAR, CONST|TMP|VAR|UNUSED|CV)
01983 {
01984        zend_op *opline = EX(opline);
01985        zval *function_name;
01986        zend_class_entry *ce;
01987 
01988        zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), EX(called_scope));
01989 
01990        if (OP1_TYPE == IS_CONST) {
01991               /* no function found. try a static method in class */
01992               ce = zend_fetch_class(Z_STRVAL(opline->op1.u.constant), Z_STRLEN(opline->op1.u.constant), opline->extended_value TSRMLS_CC);
01993               if (!ce) {
01994                      zend_error_noreturn(E_ERROR, "Class '%s' not found", Z_STRVAL(opline->op1.u.constant));
01995               }
01996               EX(called_scope) = ce;
01997        } else {
01998               ce = EX_T(opline->op1.u.var).class_entry;
01999               
02000               if (opline->op1.u.EA.type == ZEND_FETCH_CLASS_PARENT || opline->op1.u.EA.type == ZEND_FETCH_CLASS_SELF) {
02001                      EX(called_scope) = EG(called_scope);
02002               } else {
02003                      EX(called_scope) = ce;
02004               }
02005        }
02006        if(OP2_TYPE != IS_UNUSED) {
02007               char *function_name_strval = NULL;
02008               int function_name_strlen = 0;
02009               zend_free_op free_op2;
02010 
02011               if (OP2_TYPE == IS_CONST) {
02012                      function_name_strval = Z_STRVAL(opline->op2.u.constant);
02013                      function_name_strlen = Z_STRLEN(opline->op2.u.constant);
02014               } else {
02015                      function_name = GET_OP2_ZVAL_PTR(BP_VAR_R);
02016 
02017                      if (Z_TYPE_P(function_name) != IS_STRING) {
02018                             zend_error_noreturn(E_ERROR, "Function name must be a string");
02019                      } else {
02020                             function_name_strval = Z_STRVAL_P(function_name);
02021                             function_name_strlen = Z_STRLEN_P(function_name);
02022                      }
02023               }
02024 
02025               if (function_name_strval) {
02026                      if (ce->get_static_method) {
02027                             EX(fbc) = ce->get_static_method(ce, function_name_strval, function_name_strlen TSRMLS_CC);
02028                      } else {
02029                             EX(fbc) = zend_std_get_static_method(ce, function_name_strval, function_name_strlen TSRMLS_CC);
02030                      }
02031                      if (!EX(fbc)) {
02032                             zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", ce->name, function_name_strval);
02033                      }
02034               }
02035 
02036               if (OP2_TYPE != IS_CONST) {
02037                      FREE_OP2();
02038               }
02039        } else {
02040               if(!ce->constructor) {
02041                      zend_error_noreturn(E_ERROR, "Cannot call constructor");
02042               }
02043               if (EG(This) && Z_OBJCE_P(EG(This)) != ce->constructor->common.scope && (ce->constructor->common.fn_flags & ZEND_ACC_PRIVATE)) {
02044                      zend_error(E_COMPILE_ERROR, "Cannot call private %s::__construct()", ce->name);
02045               }
02046               EX(fbc) = ce->constructor;
02047        }
02048 
02049        if (EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) {
02050               EX(object) = NULL;
02051        } else {
02052               if (EG(This) &&
02053                   Z_OBJ_HT_P(EG(This))->get_class_entry &&
02054                   !instanceof_function(Z_OBJCE_P(EG(This)), ce TSRMLS_CC)) {
02055                   /* We are calling method of the other (incompatible) class,
02056                      but passing $this. This is done for compatibility with php-4. */
02057                      int severity;
02058                      char *verb;
02059                      if (EX(fbc)->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
02060                             severity = E_STRICT;
02061                             verb = "should not";
02062                      } else {
02063                             /* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */
02064                             severity = E_ERROR;
02065                             verb = "cannot";
02066                      }
02067                      zend_error(severity, "Non-static method %s::%s() %s be called statically, assuming $this from incompatible context", EX(fbc)->common.scope->name, EX(fbc)->common.function_name, verb);
02068 
02069               }
02070               if ((EX(object) = EG(This))) {
02071                      Z_ADDREF_P(EX(object));
02072                      EX(called_scope) = Z_OBJCE_P(EX(object));
02073               }
02074        }
02075 
02076        ZEND_VM_NEXT_OPCODE();
02077 }
02078 
02079 ZEND_VM_HANDLER(59, ZEND_INIT_FCALL_BY_NAME, ANY, CONST|TMP|VAR|CV)
02080 {
02081        zend_op *opline = EX(opline);
02082        zval *function_name;
02083        char *function_name_strval, *lcname;
02084        int function_name_strlen;
02085        zend_free_op free_op2;
02086 
02087        zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), EX(called_scope));
02088 
02089        if (OP2_TYPE == IS_CONST) {
02090               if (zend_hash_quick_find(EG(function_table), Z_STRVAL(opline->op1.u.constant), Z_STRLEN(opline->op1.u.constant)+1, opline->extended_value, (void **) &EX(fbc)) == FAILURE) {
02091                      zend_error_noreturn(E_ERROR, "Call to undefined function %s()", Z_STRVAL(opline->op2.u.constant));
02092               }
02093        } else {
02094               function_name = GET_OP2_ZVAL_PTR(BP_VAR_R);
02095 
02096               if (OP2_TYPE != IS_CONST && OP2_TYPE != IS_TMP_VAR &&
02097                   Z_TYPE_P(function_name) == IS_OBJECT &&
02098                      Z_OBJ_HANDLER_P(function_name, get_closure) &&
02099                      Z_OBJ_HANDLER_P(function_name, get_closure)(function_name, &EX(called_scope), &EX(fbc), &EX(object) TSRMLS_CC) == SUCCESS) {
02100                      if (EX(object)) {
02101                             Z_ADDREF_P(EX(object));
02102                      }
02103                      if (OP2_TYPE == IS_VAR && OP2_FREE &&
02104                          EX(fbc)->common.fn_flags & ZEND_ACC_CLOSURE) {
02105                             /* Delay closure destruction until its invocation */
02106                             EX(fbc)->common.prototype = (zend_function*)function_name;
02107                      } else {
02108                             FREE_OP2();
02109                      }
02110                      ZEND_VM_NEXT_OPCODE();
02111               }
02112 
02113               if (Z_TYPE_P(function_name) != IS_STRING) {
02114                      zend_error_noreturn(E_ERROR, "Function name must be a string");
02115               }
02116               function_name_strval = Z_STRVAL_P(function_name);
02117               function_name_strlen = Z_STRLEN_P(function_name);
02118               if (function_name_strval[0] == '\\') {
02119 
02120                   function_name_strlen -= 1;
02121                      lcname = zend_str_tolower_dup(function_name_strval + 1, function_name_strlen);
02122               } else {
02123                      lcname = zend_str_tolower_dup(function_name_strval, function_name_strlen);
02124               }
02125               if (zend_hash_find(EG(function_table), lcname, function_name_strlen+1, (void **) &EX(fbc)) == FAILURE) {
02126                      zend_error_noreturn(E_ERROR, "Call to undefined function %s()", function_name_strval);
02127               }
02128               efree(lcname);
02129               FREE_OP2();
02130        }
02131 
02132        EX(object) = NULL;
02133        ZEND_VM_NEXT_OPCODE();
02134 }
02135 
02136 
02137 ZEND_VM_HANDLER(69, ZEND_INIT_NS_FCALL_BY_NAME, ANY, CONST)
02138 {
02139        zend_op *opline = EX(opline);
02140        zend_op *op_data = opline + 1;
02141 
02142        ZEND_VM_INC_OPCODE();
02143        zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), EX(called_scope));
02144 
02145        if (zend_hash_quick_find(EG(function_table), Z_STRVAL(opline->op1.u.constant), Z_STRLEN(opline->op1.u.constant)+1, opline->extended_value, (void **) &EX(fbc))==FAILURE) {
02146               char *short_name = Z_STRVAL(opline->op1.u.constant)+Z_LVAL(op_data->op1.u.constant);
02147               if (zend_hash_quick_find(EG(function_table), short_name, Z_STRLEN(opline->op1.u.constant)-Z_LVAL(op_data->op1.u.constant)+1, op_data->extended_value, (void **) &EX(fbc))==FAILURE) {
02148                      zend_error_noreturn(E_ERROR, "Call to undefined function %s()", Z_STRVAL(opline->op2.u.constant));
02149               }
02150        }
02151 
02152        EX(object) = NULL;
02153        ZEND_VM_NEXT_OPCODE();
02154 }
02155 
02156 ZEND_VM_HELPER(zend_leave_helper, ANY, ANY)
02157 {
02158        zend_bool nested;
02159        zend_op_array *op_array = EX(op_array);
02160 
02161        EG(current_execute_data) = EX(prev_execute_data);
02162        EG(opline_ptr) = NULL;
02163        if (!EG(active_symbol_table)) {
02164               zval ***cv = EX(CVs);
02165               zval ***end = cv + EX(op_array)->last_var;
02166               while (cv != end) {
02167                      if (*cv) {
02168                             zval_ptr_dtor(*cv);
02169                      }
02170                      cv++;
02171               }
02172        }
02173        
02174        if ((op_array->fn_flags & ZEND_ACC_CLOSURE) && op_array->prototype) {
02175               zval_ptr_dtor((zval**)&op_array->prototype);
02176        }
02177 
02178        nested = EX(nested);
02179        
02180        zend_vm_stack_free(execute_data TSRMLS_CC);
02181 
02182        if (nested) {
02183               execute_data = EG(current_execute_data);
02184 
02185               if (EX(call_opline)->opcode == ZEND_INCLUDE_OR_EVAL) {
02186 
02187                      EX(function_state).function = (zend_function *) EX(op_array);
02188                      EX(function_state).arguments = NULL;
02189                      EX(object) = EX(current_object);
02190 
02191                      if (RETURN_VALUE_USED(EX(call_opline))) {
02192                             if (!EX_T(EX(call_opline)->result.u.var).var.ptr) { /* there was no return statement */
02193                                    ALLOC_ZVAL(EX_T(EX(call_opline)->result.u.var).var.ptr);
02194                                    INIT_PZVAL(EX_T(EX(call_opline)->result.u.var).var.ptr);
02195                                    Z_LVAL_P(EX_T(EX(call_opline)->result.u.var).var.ptr) = 1;
02196                                    Z_TYPE_P(EX_T(EX(call_opline)->result.u.var).var.ptr) = IS_BOOL;
02197                             }
02198                      }
02199 
02200                      EG(opline_ptr) = &EX(opline);
02201                      EG(active_op_array) = EX(op_array);
02202                      EG(return_value_ptr_ptr) = EX(original_return_value);
02203                      destroy_op_array(op_array TSRMLS_CC);
02204                      efree(op_array);
02205                      if (EG(exception)) {
02206                             zend_throw_exception_internal(NULL TSRMLS_CC);
02207                      }
02208 
02209                      EX(opline)++;
02210                      ZEND_VM_LEAVE();
02211               } else {
02212 
02213                      EG(opline_ptr) = &EX(opline);
02214                      EG(active_op_array) = EX(op_array);
02215                      EG(return_value_ptr_ptr) = EX(original_return_value);
02216                      if (EG(active_symbol_table)) {
02217                             if (EG(symtable_cache_ptr)>=EG(symtable_cache_limit)) {
02218                                    zend_hash_destroy(EG(active_symbol_table));
02219                                    FREE_HASHTABLE(EG(active_symbol_table));
02220                             } else {
02221                                    /* clean before putting into the cache, since clean
02222                                       could call dtors, which could use cached hash */
02223                                    zend_hash_clean(EG(active_symbol_table));
02224                                    *(++EG(symtable_cache_ptr)) = EG(active_symbol_table);
02225                             }
02226                      }
02227                      EG(active_symbol_table) = EX(symbol_table);
02228 
02229                      EX(function_state).function = (zend_function *) EX(op_array);
02230                      EX(function_state).arguments = NULL;
02231 
02232                      if (EG(This)) {
02233                             if (EG(exception) && IS_CTOR_CALL(EX(called_scope))) {
02234                                    if (IS_CTOR_USED(EX(called_scope))) {
02235                                           Z_DELREF_P(EG(This));
02236                                    }
02237                                    if (Z_REFCOUNT_P(EG(This)) == 1) {
02238                                           zend_object_store_ctor_failed(EG(This) TSRMLS_CC);
02239                                    }
02240                             }
02241                             zval_ptr_dtor(&EG(This));
02242                      }
02243                      EG(This) = EX(current_this);
02244                      EG(scope) = EX(current_scope);
02245                      EG(called_scope) = EX(current_called_scope);
02246 
02247                      EX(object) = EX(current_object);
02248                      EX(called_scope) = DECODE_CTOR(EX(called_scope));
02249 
02250                      zend_vm_stack_clear_multiple(TSRMLS_C);
02251 
02252                      if (EG(exception)) {
02253                             zend_throw_exception_internal(NULL TSRMLS_CC);
02254                             if (RETURN_VALUE_USED(EX(call_opline)) && EX_T(EX(call_opline)->result.u.var).var.ptr) {
02255                                    zval_ptr_dtor(&EX_T(EX(call_opline)->result.u.var).var.ptr);
02256                             }
02257                      }
02258 
02259                      EX(opline)++;
02260                      ZEND_VM_LEAVE();
02261               }
02262        }
02263        ZEND_VM_RETURN();
02264 }
02265 
02266 ZEND_VM_HELPER(zend_do_fcall_common_helper, ANY, ANY)
02267 {
02268        zend_op *opline = EX(opline);
02269        zend_bool should_change_scope = 0;
02270 
02271        if (EX(function_state).function->common.fn_flags & (ZEND_ACC_ABSTRACT|ZEND_ACC_DEPRECATED)) {
02272               if (EX(function_state).function->common.fn_flags & ZEND_ACC_ABSTRACT) {
02273                      zend_error_noreturn(E_ERROR, "Cannot call abstract method %s::%s()", EX(function_state).function->common.scope->name, EX(function_state).function->common.function_name);
02274                      ZEND_VM_NEXT_OPCODE(); /* Never reached */
02275               }
02276               if (EX(function_state).function->common.fn_flags & ZEND_ACC_DEPRECATED) {
02277                      zend_error(E_DEPRECATED, "Function %s%s%s() is deprecated",
02278                             EX(function_state).function->common.scope ? EX(function_state).function->common.scope->name : "",
02279                             EX(function_state).function->common.scope ? "::" : "",
02280                             EX(function_state).function->common.function_name);
02281               }
02282        }
02283        if (EX(function_state).function->common.scope &&
02284               !(EX(function_state).function->common.fn_flags & ZEND_ACC_STATIC) &&
02285               !EX(object)) {
02286 
02287               if (EX(function_state).function->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
02288                      /* FIXME: output identifiers properly */
02289                      zend_error(E_STRICT, "Non-static method %s::%s() should not be called statically", EX(function_state).function->common.scope->name, EX(function_state).function->common.function_name);
02290               } else {
02291                      /* FIXME: output identifiers properly */
02292                      /* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */
02293                      zend_error_noreturn(E_ERROR, "Non-static method %s::%s() cannot be called statically", EX(function_state).function->common.scope->name, EX(function_state).function->common.function_name);
02294               }
02295        }
02296 
02297        if (EX(function_state).function->type == ZEND_USER_FUNCTION ||
02298            EX(function_state).function->common.scope) {
02299               should_change_scope = 1;
02300               EX(current_this) = EG(This);
02301               EX(current_scope) = EG(scope);
02302               EX(current_called_scope) = EG(called_scope);
02303               EG(This) = EX(object);
02304               EG(scope) = (EX(function_state).function->type == ZEND_USER_FUNCTION || !EX(object)) ? EX(function_state).function->common.scope : NULL;
02305               EG(called_scope) = EX(called_scope);
02306        }
02307 
02308        zend_arg_types_stack_3_pop(&EG(arg_types_stack), &EX(called_scope), &EX(current_object), &EX(fbc));
02309        EX(function_state).arguments = zend_vm_stack_push_args(opline->extended_value TSRMLS_CC);
02310 
02311        if (EX(function_state).function->type == ZEND_INTERNAL_FUNCTION) {
02312               ALLOC_INIT_ZVAL(EX_T(opline->result.u.var).var.ptr);
02313               EX_T(opline->result.u.var).var.ptr_ptr = &EX_T(opline->result.u.var).var.ptr;
02314               EX_T(opline->result.u.var).var.fcall_returned_reference = EX(function_state).function->common.return_reference;
02315 
02316               if (EX(function_state).function->common.arg_info) {
02317                      zend_uint i=0;
02318                      zval **p = (zval**)EX(function_state).arguments;
02319                      ulong arg_count = opline->extended_value;
02320 
02321                      while (arg_count>0) {
02322                             zend_verify_arg_type(EX(function_state).function, ++i, *(p-arg_count), 0 TSRMLS_CC);
02323                             arg_count--;
02324                      }
02325               }
02326               if (!zend_execute_internal) {
02327                      /* saves one function call if zend_execute_internal is not used */
02328                      ((zend_internal_function *) EX(function_state).function)->handler(opline->extended_value, EX_T(opline->result.u.var).var.ptr, EX(function_state).function->common.return_reference?&EX_T(opline->result.u.var).var.ptr:NULL, EX(object), RETURN_VALUE_USED(opline) TSRMLS_CC);
02329               } else {
02330                      zend_execute_internal(EXECUTE_DATA, RETURN_VALUE_USED(opline) TSRMLS_CC);
02331               }
02332 
02333               if (!RETURN_VALUE_USED(opline)) {
02334                      zval_ptr_dtor(&EX_T(opline->result.u.var).var.ptr);
02335               }
02336        } else if (EX(function_state).function->type == ZEND_USER_FUNCTION) {
02337               EX(original_return_value) = EG(return_value_ptr_ptr);
02338               EG(active_symbol_table) = NULL;
02339               EG(active_op_array) = &EX(function_state).function->op_array;
02340               EG(return_value_ptr_ptr) = NULL;
02341               if (RETURN_VALUE_USED(opline)) {                 
02342                      EG(return_value_ptr_ptr) = &EX_T(opline->result.u.var).var.ptr;
02343                      EX_T(opline->result.u.var).var.ptr = NULL;
02344                      EX_T(opline->result.u.var).var.ptr_ptr = &EX_T(opline->result.u.var).var.ptr;
02345                      EX_T(opline->result.u.var).var.fcall_returned_reference = EX(function_state).function->common.return_reference;
02346               }
02347 
02348               if (zend_execute == execute && !EG(exception)) {
02349                      EX(call_opline) = opline;
02350                      ZEND_VM_ENTER();
02351               } else {
02352                      zend_execute(EG(active_op_array) TSRMLS_CC);
02353               }
02354 
02355               EG(opline_ptr) = &EX(opline);
02356               EG(active_op_array) = EX(op_array);
02357               EG(return_value_ptr_ptr) = EX(original_return_value);
02358               if (EG(active_symbol_table)) {
02359                      if (EG(symtable_cache_ptr)>=EG(symtable_cache_limit)) {
02360                             zend_hash_destroy(EG(active_symbol_table));
02361                             FREE_HASHTABLE(EG(active_symbol_table));
02362                      } else {
02363                             /* clean before putting into the cache, since clean
02364                                could call dtors, which could use cached hash */
02365                             zend_hash_clean(EG(active_symbol_table));
02366                             *(++EG(symtable_cache_ptr)) = EG(active_symbol_table);
02367                      }
02368               }
02369               EG(active_symbol_table) = EX(symbol_table);
02370        } else { /* ZEND_OVERLOADED_FUNCTION */
02371               ALLOC_INIT_ZVAL(EX_T(opline->result.u.var).var.ptr);
02372 
02373                      /* Not sure what should be done here if it's a static method */
02374               if (EX(object)) {
02375                      Z_OBJ_HT_P(EX(object))->call_method(EX(function_state).function->common.function_name, opline->extended_value, EX_T(opline->result.u.var).var.ptr, &EX_T(opline->result.u.var).var.ptr, EX(object), RETURN_VALUE_USED(opline) TSRMLS_CC);
02376               } else {
02377                      zend_error_noreturn(E_ERROR, "Cannot call overloaded function for non-object");
02378               }
02379 
02380               if (EX(function_state).function->type == ZEND_OVERLOADED_FUNCTION_TEMPORARY) {
02381                      efree(EX(function_state).function->common.function_name);
02382               }
02383               efree(EX(function_state).function);
02384 
02385               if (!RETURN_VALUE_USED(opline)) {
02386                      zval_ptr_dtor(&EX_T(opline->result.u.var).var.ptr);
02387               } else {
02388                      Z_UNSET_ISREF_P(EX_T(opline->result.u.var).var.ptr);
02389                      Z_SET_REFCOUNT_P(EX_T(opline->result.u.var).var.ptr, 1);
02390                      EX_T(opline->result.u.var).var.fcall_returned_reference = 0;
02391                      EX_T(opline->result.u.var).var.ptr_ptr = &EX_T(opline->result.u.var).var.ptr;
02392               }
02393        }
02394 
02395        EX(function_state).function = (zend_function *) EX(op_array);
02396        EX(function_state).arguments = NULL;
02397 
02398        if (should_change_scope) {
02399               if (EG(This)) {
02400                      if (EG(exception) && IS_CTOR_CALL(EX(called_scope))) {
02401                             if (IS_CTOR_USED(EX(called_scope))) {
02402                                    Z_DELREF_P(EG(This));
02403                             }
02404                             if (Z_REFCOUNT_P(EG(This)) == 1) {
02405                                    zend_object_store_ctor_failed(EG(This) TSRMLS_CC);
02406                             }
02407                      }
02408                      zval_ptr_dtor(&EG(This));
02409               }
02410               EG(This) = EX(current_this);
02411               EG(scope) = EX(current_scope);
02412               EG(called_scope) = EX(current_called_scope);
02413        }
02414 
02415        EX(object) = EX(current_object);
02416        EX(called_scope) = DECODE_CTOR(EX(called_scope));
02417 
02418        zend_vm_stack_clear_multiple(TSRMLS_C);
02419 
02420        if (EG(exception)) {
02421               zend_throw_exception_internal(NULL TSRMLS_CC);
02422               if (RETURN_VALUE_USED(opline) && EX_T(opline->result.u.var).var.ptr) {
02423                      zval_ptr_dtor(&EX_T(opline->result.u.var).var.ptr);
02424               }
02425        }
02426 
02427        ZEND_VM_NEXT_OPCODE();
02428 }
02429 
02430 ZEND_VM_HANDLER(61, ZEND_DO_FCALL_BY_NAME, ANY, ANY)
02431 {
02432        EX(function_state).function = EX(fbc);
02433        ZEND_VM_DISPATCH_TO_HELPER(zend_do_fcall_common_helper);
02434 }
02435 
02436 ZEND_VM_HANDLER(60, ZEND_DO_FCALL, CONST, ANY)
02437 {
02438        zend_op *opline = EX(opline);
02439        zend_free_op free_op1;
02440        zval *fname = GET_OP1_ZVAL_PTR(BP_VAR_R);
02441 
02442        zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), EX(called_scope));
02443 
02444        if (zend_hash_quick_find(EG(function_table), fname->value.str.val, fname->value.str.len+1, Z_LVAL(opline->op2.u.constant), (void **) &EX(function_state).function)==FAILURE) {
02445               zend_error_noreturn(E_ERROR, "Call to undefined function %s()", fname->value.str.val);
02446        }
02447        EX(object) = NULL;
02448 
02449        FREE_OP1();
02450 
02451        ZEND_VM_DISPATCH_TO_HELPER(zend_do_fcall_common_helper);
02452 }
02453 
02454 ZEND_VM_HANDLER(62, ZEND_RETURN, CONST|TMP|VAR|CV, ANY)
02455 {
02456        zend_op *opline = EX(opline);
02457        zval *retval_ptr;
02458        zval **retval_ptr_ptr;
02459        zend_free_op free_op1;
02460 
02461        if (EG(active_op_array)->return_reference == ZEND_RETURN_REF) {
02462 
02463               if (OP1_TYPE == IS_CONST || OP1_TYPE == IS_TMP_VAR) {
02464                      /* Not supposed to happen, but we'll allow it */
02465                      zend_error(E_NOTICE, "Only variable references should be returned by reference");
02466                      ZEND_VM_C_GOTO(return_by_value);
02467               }
02468 
02469               retval_ptr_ptr = GET_OP1_ZVAL_PTR_PTR(BP_VAR_W);
02470 
02471               if (OP1_TYPE == IS_VAR && !retval_ptr_ptr) {
02472                      zend_error_noreturn(E_ERROR, "Cannot return string offsets by reference");
02473               }
02474 
02475               if (OP1_TYPE == IS_VAR && !Z_ISREF_PP(retval_ptr_ptr)) {
02476                      if (opline->extended_value == ZEND_RETURNS_FUNCTION &&
02477                          EX_T(opline->op1.u.var).var.fcall_returned_reference) {
02478                      } else if (EX_T(opline->op1.u.var).var.ptr_ptr == &EX_T(opline->op1.u.var).var.ptr) {
02479                             if (OP1_TYPE == IS_VAR && !OP1_FREE) {
02480                                    PZVAL_LOCK(*retval_ptr_ptr); /* undo the effect of get_zval_ptr_ptr() */
02481                             }
02482                             zend_error(E_NOTICE, "Only variable references should be returned by reference");
02483                             ZEND_VM_C_GOTO(return_by_value);
02484                      }
02485               }
02486 
02487               if (EG(return_value_ptr_ptr)) {
02488                      SEPARATE_ZVAL_TO_MAKE_IS_REF(retval_ptr_ptr);
02489                      Z_ADDREF_PP(retval_ptr_ptr);
02490 
02491                      (*EG(return_value_ptr_ptr)) = (*retval_ptr_ptr);
02492               }
02493        } else {
02494 ZEND_VM_C_LABEL(return_by_value):
02495 
02496               retval_ptr = GET_OP1_ZVAL_PTR(BP_VAR_R);
02497 
02498               if (!EG(return_value_ptr_ptr)) {
02499                      if (OP1_TYPE == IS_TMP_VAR) {
02500                             FREE_OP1();
02501                      }
02502               } else if (!IS_OP1_TMP_FREE()) { /* Not a temp var */
02503                      if (OP1_TYPE == IS_CONST ||
02504                          EG(active_op_array)->return_reference == ZEND_RETURN_REF ||
02505                          (PZVAL_IS_REF(retval_ptr) && Z_REFCOUNT_P(retval_ptr) > 0)) {
02506                             zval *ret;
02507 
02508                             ALLOC_ZVAL(ret);
02509                             INIT_PZVAL_COPY(ret, retval_ptr);
02510                             zval_copy_ctor(ret);
02511                             *EG(return_value_ptr_ptr) = ret;
02512                      } else if ((OP1_TYPE == IS_CV || OP1_TYPE == IS_VAR) &&
02513                                 retval_ptr == &EG(uninitialized_zval)) {
02514                             zval *ret;
02515 
02516                             ALLOC_INIT_ZVAL(ret);
02517                             *EG(return_value_ptr_ptr) = ret;
02518                      } else {
02519                             *EG(return_value_ptr_ptr) = retval_ptr;
02520                             Z_ADDREF_P(retval_ptr);
02521                      }
02522               } else {
02523                      zval *ret;
02524 
02525                      ALLOC_ZVAL(ret);
02526                      INIT_PZVAL_COPY(ret, retval_ptr);
02527                      *EG(return_value_ptr_ptr) = ret;
02528               }
02529        }
02530        FREE_OP1_IF_VAR();
02531        ZEND_VM_DISPATCH_TO_HELPER(zend_leave_helper);
02532 }
02533 
02534 ZEND_VM_HANDLER(108, ZEND_THROW, CONST|TMP|VAR|CV, ANY)
02535 {
02536        zend_op *opline = EX(opline);
02537        zval *value;
02538        zval *exception;
02539        zend_free_op free_op1;
02540 
02541        value = GET_OP1_ZVAL_PTR(BP_VAR_R);
02542 
02543        if (OP1_TYPE == IS_CONST || Z_TYPE_P(value) != IS_OBJECT) {
02544               zend_error_noreturn(E_ERROR, "Can only throw objects");
02545        }
02546        zend_exception_save(TSRMLS_C);
02547        /* Not sure if a complete copy is what we want here */
02548        ALLOC_ZVAL(exception);
02549        INIT_PZVAL_COPY(exception, value);
02550        if (!IS_OP1_TMP_FREE()) {
02551               zval_copy_ctor(exception);
02552        }
02553 
02554        zend_throw_exception_object(exception TSRMLS_CC);
02555        zend_exception_restore(TSRMLS_C);
02556        FREE_OP1_IF_VAR();
02557        ZEND_VM_NEXT_OPCODE();
02558 }
02559 
02560 ZEND_VM_HANDLER(107, ZEND_CATCH, ANY, CV)
02561 {
02562        zend_op *opline = EX(opline);
02563        zend_class_entry *ce;
02564 
02565        /* Check whether an exception has been thrown, if not, jump over code */
02566        zend_exception_restore(TSRMLS_C);
02567        if (EG(exception) == NULL) {
02568               ZEND_VM_SET_OPCODE(&EX(op_array)->opcodes[opline->extended_value]);
02569               ZEND_VM_CONTINUE(); /* CHECK_ME */
02570        }
02571        ce = Z_OBJCE_P(EG(exception));
02572        if (ce != EX_T(opline->op1.u.var).class_entry) {
02573               if (!instanceof_function(ce, EX_T(opline->op1.u.var).class_entry TSRMLS_CC)) {
02574                      if (opline->op1.u.EA.type) {
02575                             zend_throw_exception_internal(NULL TSRMLS_CC);
02576                             ZEND_VM_NEXT_OPCODE();
02577                      }
02578                      ZEND_VM_SET_OPCODE(&EX(op_array)->opcodes[opline->extended_value]);
02579                      ZEND_VM_CONTINUE(); /* CHECK_ME */
02580               }
02581        }
02582 
02583        if (!EG(active_symbol_table)) {
02584               if (EX(CVs)[opline->op2.u.var]) {
02585                      zval_ptr_dtor(EX(CVs)[opline->op2.u.var]);
02586               }
02587               EX(CVs)[opline->op2.u.var] = (zval**)EX(CVs) + (EX(op_array)->last_var + opline->op2.u.var);
02588               *EX(CVs)[opline->op2.u.var] = EG(exception);
02589        } else {
02590               zend_compiled_variable *cv = &CV_DEF_OF(opline->op2.u.var);
02591               zend_hash_quick_update(EG(active_symbol_table), cv->name, cv->name_len+1, cv->hash_value,
02592                   &EG(exception), sizeof(zval *), (void**)&EX(CVs)[opline->op2.u.var]);
02593        }
02594        EG(exception) = NULL;
02595        ZEND_VM_NEXT_OPCODE();
02596 }
02597 
02598 ZEND_VM_HANDLER(65, ZEND_SEND_VAL, CONST|TMP|VAR|CV, ANY)
02599 {
02600        zend_op *opline = EX(opline);
02601        if (opline->extended_value==ZEND_DO_FCALL_BY_NAME
02602               && ARG_MUST_BE_SENT_BY_REF(EX(fbc), opline->op2.u.opline_num)) {
02603                      zend_error_noreturn(E_ERROR, "Cannot pass parameter %d by reference", opline->op2.u.opline_num);
02604        }
02605        {
02606               zval *valptr;
02607               zval *value;
02608               zend_free_op free_op1;
02609 
02610               value = GET_OP1_ZVAL_PTR(BP_VAR_R);
02611 
02612               ALLOC_ZVAL(valptr);
02613               INIT_PZVAL_COPY(valptr, value);
02614               if (!IS_OP1_TMP_FREE()) {
02615                      zval_copy_ctor(valptr);
02616               }
02617               zend_vm_stack_push(valptr TSRMLS_CC);
02618               FREE_OP1_IF_VAR();
02619        }
02620        ZEND_VM_NEXT_OPCODE();
02621 }
02622 
02623 ZEND_VM_HELPER(zend_send_by_var_helper, VAR|CV, ANY)
02624 {
02625        zend_op *opline = EX(opline);
02626        zval *varptr;
02627        zend_free_op free_op1;
02628        varptr = GET_OP1_ZVAL_PTR(BP_VAR_R);
02629 
02630        if (varptr == &EG(uninitialized_zval)) {
02631               ALLOC_ZVAL(varptr);
02632               INIT_ZVAL(*varptr);
02633               Z_SET_REFCOUNT_P(varptr, 0);
02634        } else if (PZVAL_IS_REF(varptr)) {
02635               zval *original_var = varptr;
02636 
02637               ALLOC_ZVAL(varptr);
02638               *varptr = *original_var;
02639               Z_UNSET_ISREF_P(varptr);
02640               Z_SET_REFCOUNT_P(varptr, 0);
02641               zval_copy_ctor(varptr);
02642        }
02643        Z_ADDREF_P(varptr);
02644        zend_vm_stack_push(varptr TSRMLS_CC);
02645        FREE_OP1();  /* for string offsets */
02646 
02647        ZEND_VM_NEXT_OPCODE();
02648 }
02649 
02650 ZEND_VM_HANDLER(106, ZEND_SEND_VAR_NO_REF, VAR|CV, ANY)
02651 {
02652        zend_op *opline = EX(opline);
02653        zend_free_op free_op1;
02654        zval *varptr;
02655 
02656        if (opline->extended_value & ZEND_ARG_COMPILE_TIME_BOUND) { /* Had function_ptr at compile_time */
02657               if (!(opline->extended_value & ZEND_ARG_SEND_BY_REF)) {
02658                      ZEND_VM_DISPATCH_TO_HELPER(zend_send_by_var_helper);
02659               }
02660        } else if (!ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->op2.u.opline_num)) {
02661               ZEND_VM_DISPATCH_TO_HELPER(zend_send_by_var_helper);
02662        }
02663 
02664        if (OP1_TYPE == IS_VAR &&
02665               (opline->extended_value & ZEND_ARG_SEND_FUNCTION) &&
02666               EX_T(opline->op1.u.var).var.fcall_returned_reference &&
02667               EX_T(opline->op1.u.var).var.ptr) {
02668               varptr = EX_T(opline->op1.u.var).var.ptr;
02669               PZVAL_UNLOCK_EX(varptr, &free_op1, 0);
02670        } else {
02671               varptr = GET_OP1_ZVAL_PTR(BP_VAR_R);
02672        }
02673        if ((!(opline->extended_value & ZEND_ARG_SEND_FUNCTION) ||
02674             EX_T(opline->op1.u.var).var.fcall_returned_reference) &&
02675            varptr != &EG(uninitialized_zval) &&
02676            (PZVAL_IS_REF(varptr) ||
02677             (Z_REFCOUNT_P(varptr) == 1 && (OP1_TYPE == IS_CV || free_op1.var)))) {
02678               Z_SET_ISREF_P(varptr);
02679               Z_ADDREF_P(varptr);
02680               zend_vm_stack_push(varptr TSRMLS_CC);
02681        } else {
02682               zval *valptr;
02683 
02684               if ((opline->extended_value & ZEND_ARG_COMPILE_TIME_BOUND) ?
02685                      !(opline->extended_value & ZEND_ARG_SEND_SILENT) :
02686                      !ARG_MAY_BE_SENT_BY_REF(EX(fbc), opline->op2.u.opline_num)) {
02687                      zend_error(E_STRICT, "Only variables should be passed by reference");
02688               }
02689               ALLOC_ZVAL(valptr);
02690               INIT_PZVAL_COPY(valptr, varptr);
02691               if (!IS_OP1_TMP_FREE()) {
02692                      zval_copy_ctor(valptr);
02693               }
02694               zend_vm_stack_push(valptr TSRMLS_CC);
02695        }
02696        FREE_OP1_IF_VAR();
02697        ZEND_VM_NEXT_OPCODE();
02698 }
02699 
02700 ZEND_VM_HANDLER(67, ZEND_SEND_REF, VAR|CV, ANY)
02701 {
02702        zend_op *opline = EX(opline);
02703        zend_free_op free_op1;
02704        zval **varptr_ptr;
02705        zval *varptr;
02706        varptr_ptr = GET_OP1_ZVAL_PTR_PTR(BP_VAR_W);
02707 
02708        if (OP1_TYPE == IS_VAR && !varptr_ptr) {
02709               zend_error_noreturn(E_ERROR, "Only variables can be passed by reference");
02710        }
02711 
02712        if (OP1_TYPE == IS_VAR && *varptr_ptr == EG(error_zval_ptr)) {
02713               ALLOC_INIT_ZVAL(varptr);
02714               zend_vm_stack_push(varptr TSRMLS_CC);
02715               ZEND_VM_NEXT_OPCODE();
02716        }
02717 
02718        if (EX(function_state).function->type == ZEND_INTERNAL_FUNCTION && !ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->op2.u.opline_num)) {
02719               ZEND_VM_DISPATCH_TO_HELPER(zend_send_by_var_helper);
02720        }
02721 
02722        SEPARATE_ZVAL_TO_MAKE_IS_REF(varptr_ptr);
02723        varptr = *varptr_ptr;
02724        Z_ADDREF_P(varptr);
02725        zend_vm_stack_push(varptr TSRMLS_CC);
02726 
02727        FREE_OP1_VAR_PTR();
02728        ZEND_VM_NEXT_OPCODE();
02729 }
02730 
02731 ZEND_VM_HANDLER(66, ZEND_SEND_VAR, VAR|CV, ANY)
02732 {
02733        zend_op *opline = EX(opline);
02734 
02735        if ((opline->extended_value == ZEND_DO_FCALL_BY_NAME)
02736               && ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->op2.u.opline_num)) {
02737               ZEND_VM_DISPATCH_TO_HANDLER(ZEND_SEND_REF);
02738        }
02739        ZEND_VM_DISPATCH_TO_HELPER(zend_send_by_var_helper);
02740 }
02741 
02742 ZEND_VM_HANDLER(63, ZEND_RECV, ANY, ANY)
02743 {
02744        zend_op *opline = EX(opline);
02745        zend_uint arg_num = Z_LVAL(opline->op1.u.constant);
02746        zval **param = zend_vm_stack_get_arg(arg_num TSRMLS_CC);
02747 
02748        if (param == NULL) {
02749               char *space;
02750               char *class_name = get_active_class_name(&space TSRMLS_CC);
02751               zend_execute_data *ptr = EX(prev_execute_data);
02752 
02753               if (zend_verify_arg_type((zend_function *) EG(active_op_array), arg_num, NULL, opline->extended_value TSRMLS_CC)) {
02754                      if(ptr && ptr->op_array) {
02755                             zend_error(E_WARNING, "Missing argument %ld for %s%s%s(), called in %s on line %d and defined", opline->op1.u.constant.value.lval, class_name, space, get_active_function_name(TSRMLS_C), ptr->op_array->filename, ptr->opline->lineno);
02756                      } else {
02757                             zend_error(E_WARNING, "Missing argument %ld for %s%s%s()", opline->op1.u.constant.value.lval, class_name, space, get_active_function_name(TSRMLS_C));
02758                      }
02759               }
02760               if (opline->result.op_type == IS_VAR) {
02761                      PZVAL_UNLOCK_FREE(*EX_T(opline->result.u.var).var.ptr_ptr);
02762               }
02763        } else {
02764               zend_free_op free_res;
02765               zval **var_ptr;
02766 
02767               zend_verify_arg_type((zend_function *) EG(active_op_array), arg_num, *param, opline->extended_value TSRMLS_CC);
02768               var_ptr = get_zval_ptr_ptr(&opline->result, EX(Ts), &free_res, BP_VAR_W);
02769               Z_DELREF_PP(var_ptr);
02770               *var_ptr = *param;
02771               Z_ADDREF_PP(var_ptr);
02772        }
02773 
02774        ZEND_VM_NEXT_OPCODE();
02775 }
02776 
02777 ZEND_VM_HANDLER(64, ZEND_RECV_INIT, ANY, CONST)
02778 {
02779        zend_op *opline = EX(opline);
02780        zval *assignment_value;
02781        zend_uint arg_num = Z_LVAL(opline->op1.u.constant);
02782        zend_free_op free_res;
02783        zval **param = zend_vm_stack_get_arg(arg_num TSRMLS_CC);
02784        zval **var_ptr;
02785 
02786        if (param == NULL) {
02787               ALLOC_ZVAL(assignment_value);
02788               *assignment_value = opline->op2.u.constant;
02789               if ((Z_TYPE(opline->op2.u.constant) & IS_CONSTANT_TYPE_MASK) == IS_CONSTANT || Z_TYPE(opline->op2.u.constant)==IS_CONSTANT_ARRAY) {
02790                      Z_SET_REFCOUNT_P(assignment_value, 1);
02791                      zval_update_constant(&assignment_value, 0 TSRMLS_CC);
02792               } else {
02793                      zval_copy_ctor(assignment_value);
02794               }
02795               INIT_PZVAL(assignment_value);
02796        } else {
02797               assignment_value = *param;
02798               Z_ADDREF_P(assignment_value);
02799        }
02800 
02801        zend_verify_arg_type((zend_function *) EG(active_op_array), arg_num, assignment_value, opline->extended_value TSRMLS_CC);
02802        var_ptr = get_zval_ptr_ptr(&opline->result, EX(Ts), &free_res, BP_VAR_W);
02803        Z_DELREF_PP(var_ptr);
02804        *var_ptr = assignment_value;
02805 
02806        ZEND_VM_NEXT_OPCODE();
02807 }
02808 
02809 ZEND_VM_HANDLER(52, ZEND_BOOL, CONST|TMP|VAR|CV, ANY)
02810 {
02811        zend_op *opline = EX(opline);
02812        zend_free_op free_op1;
02813 
02814        /* PHP 3.0 returned "" for false and 1 for true, here we use 0 and 1 for now */
02815        Z_LVAL(EX_T(opline->result.u.var).tmp_var) = i_zend_is_true(GET_OP1_ZVAL_PTR(BP_VAR_R));
02816        Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_BOOL;
02817        FREE_OP1();
02818 
02819        ZEND_VM_NEXT_OPCODE();
02820 }
02821 
02822 ZEND_VM_HANDLER(50, ZEND_BRK, ANY, CONST|TMP|VAR|CV)
02823 {
02824        zend_op *opline = EX(opline);
02825        zend_free_op free_op2;
02826        zend_brk_cont_element *el;
02827 
02828        el = zend_brk_cont(GET_OP2_ZVAL_PTR(BP_VAR_R), opline->op1.u.opline_num,
02829                           EX(op_array), EX(Ts) TSRMLS_CC);
02830        FREE_OP2();
02831        ZEND_VM_JMP(EX(op_array)->opcodes + el->brk);
02832 }
02833 
02834 ZEND_VM_HANDLER(51, ZEND_CONT, ANY, CONST|TMP|VAR|CV)
02835 {
02836        zend_op *opline = EX(opline);
02837        zend_free_op free_op2;
02838        zend_brk_cont_element *el;
02839 
02840        el = zend_brk_cont(GET_OP2_ZVAL_PTR(BP_VAR_R), opline->op1.u.opline_num,
02841                           EX(op_array), EX(Ts) TSRMLS_CC);
02842        FREE_OP2();
02843        ZEND_VM_JMP(EX(op_array)->opcodes + el->cont);
02844 }
02845 
02846 ZEND_VM_HANDLER(100, ZEND_GOTO, ANY, CONST)
02847 {
02848        zend_op *brk_opline;
02849        zend_op *opline = EX(opline);
02850        zend_brk_cont_element *el;
02851 
02852        el = zend_brk_cont(&opline->op2.u.constant, opline->extended_value,
02853                           EX(op_array), EX(Ts) TSRMLS_CC);
02854 
02855        brk_opline = EX(op_array)->opcodes + el->brk;
02856 
02857        switch (brk_opline->opcode) {
02858               case ZEND_SWITCH_FREE:
02859                      if (brk_opline->op1.u.EA.type != EXT_TYPE_FREE_ON_RETURN) {
02860                             zend_switch_free(&EX_T(brk_opline->op1.u.var), brk_opline->extended_value TSRMLS_CC);
02861                      }
02862                      break;
02863               case ZEND_FREE:
02864                      if (brk_opline->op1.u.EA.type != EXT_TYPE_FREE_ON_RETURN) {
02865                             zendi_zval_dtor(EX_T(brk_opline->op1.u.var).tmp_var);
02866                      }
02867                      break;
02868        }
02869        ZEND_VM_JMP(opline->op1.u.jmp_addr);
02870 }
02871 
02872 ZEND_VM_HANDLER(48, ZEND_CASE, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV)
02873 {
02874        zend_op *opline = EX(opline);
02875        int switch_expr_is_overloaded=0;
02876        zend_free_op free_op1, free_op2;
02877 
02878        if (OP1_TYPE==IS_VAR) {
02879               if (EX_T(opline->op1.u.var).var.ptr_ptr) {
02880                      PZVAL_LOCK(EX_T(opline->op1.u.var).var.ptr);
02881               } else {
02882                      switch_expr_is_overloaded = 1;
02883                      Z_ADDREF_P(EX_T(opline->op1.u.var).str_offset.str);
02884               }
02885        }
02886        is_equal_function(&EX_T(opline->result.u.var).tmp_var,
02887                              GET_OP1_ZVAL_PTR(BP_VAR_R),
02888                              GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC);
02889 
02890        FREE_OP2();
02891        if (switch_expr_is_overloaded) {
02892               /* We only free op1 if this is a string offset,
02893                * Since if it is a TMP_VAR, it'll be reused by
02894                * other CASE opcodes (whereas string offsets
02895                * are allocated at each get_zval_ptr())
02896                */
02897               FREE_OP1();
02898               EX_T(opline->op1.u.var).var.ptr_ptr = NULL;
02899               EX_T(opline->op1.u.var).var.ptr = NULL;
02900        }
02901        ZEND_VM_NEXT_OPCODE();
02902 }
02903 
02904 ZEND_VM_HANDLER(49, ZEND_SWITCH_FREE, VAR, ANY)
02905 {
02906        zend_op *opline = EX(opline);
02907 
02908        zend_switch_free(&EX_T(opline->op1.u.var), opline->extended_value TSRMLS_CC);
02909        ZEND_VM_NEXT_OPCODE();
02910 }
02911 
02912 ZEND_VM_HANDLER(68, ZEND_NEW, ANY, ANY)
02913 {
02914        zend_op *opline = EX(opline);
02915        zval *object_zval;
02916        zend_function *constructor;
02917 
02918        if (EX_T(opline->op1.u.var).class_entry->ce_flags & (ZEND_ACC_INTERFACE|ZEND_ACC_IMPLICIT_ABSTRACT_CLASS|ZEND_ACC_EXPLICIT_ABSTRACT_CLASS)) {
02919               char *class_type;
02920 
02921               if (EX_T(opline->op1.u.var).class_entry->ce_flags & ZEND_ACC_INTERFACE) {
02922                      class_type = "interface";
02923               } else {
02924                      class_type = "abstract class";
02925               }
02926               zend_error_noreturn(E_ERROR, "Cannot instantiate %s %s", class_type,  EX_T(opline->op1.u.var).class_entry->name);
02927        }
02928        ALLOC_ZVAL(object_zval);
02929        object_init_ex(object_zval, EX_T(opline->op1.u.var).class_entry);
02930        INIT_PZVAL(object_zval);
02931 
02932        constructor = Z_OBJ_HT_P(object_zval)->get_constructor(object_zval TSRMLS_CC);
02933 
02934        if (constructor == NULL) {
02935               if (RETURN_VALUE_USED(opline)) {
02936                      AI_SET_PTR(EX_T(opline->result.u.var).var, object_zval);
02937               } else {
02938                      zval_ptr_dtor(&object_zval);
02939               }
02940               ZEND_VM_JMP(EX(op_array)->opcodes + opline->op2.u.opline_num);
02941        } else {
02942               if (RETURN_VALUE_USED(opline)) {
02943                      AI_SET_PTR(EX_T(opline->result.u.var).var, object_zval);
02944                      PZVAL_LOCK(object_zval);
02945               }
02946 
02947               zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), ENCODE_CTOR(EX(called_scope), RETURN_VALUE_USED(opline)));
02948 
02949               /* We are not handling overloaded classes right now */
02950               EX(object) = object_zval;
02951               EX(fbc) = constructor;
02952               EX(called_scope) = EX_T(opline->op1.u.var).class_entry;
02953 
02954               ZEND_VM_NEXT_OPCODE();
02955        }
02956 }
02957 
02958 ZEND_VM_HANDLER(110, ZEND_CLONE, CONST|TMP|VAR|UNUSED|CV, ANY)
02959 {
02960        zend_op *opline = EX(opline);
02961        zend_free_op free_op1;
02962        zval *obj = GET_OP1_OBJ_ZVAL_PTR(BP_VAR_R);
02963        zend_class_entry *ce;
02964        zend_function *clone;
02965        zend_object_clone_obj_t clone_call;
02966 
02967        if (OP1_TYPE == IS_CONST ||
02968            (OP1_TYPE == IS_VAR && !obj) ||
02969            Z_TYPE_P(obj) != IS_OBJECT) {
02970               zend_error_noreturn(E_ERROR, "__clone method called on non-object");
02971        }
02972 
02973        ce = Z_OBJCE_P(obj);
02974        clone = ce ? ce->clone : NULL;
02975        clone_call =  Z_OBJ_HT_P(obj)->clone_obj;
02976        if (!clone_call) {
02977               if (ce) {
02978                      zend_error_noreturn(E_ERROR, "Trying to clone an uncloneable object of class %s", ce->name);
02979               } else {
02980                      zend_error_noreturn(E_ERROR, "Trying to clone an uncloneable object");
02981               }
02982        }
02983 
02984        if (ce && clone) {
02985               if (clone->op_array.fn_flags & ZEND_ACC_PRIVATE) {
02986                      /* Ensure that if we're calling a private function, we're allowed to do so.
02987                       */
02988                      if (ce != EG(scope)) {
02989                             zend_error_noreturn(E_ERROR, "Call to private %s::__clone() from context '%s'", ce->name, EG(scope) ? EG(scope)->name : "");
02990                      }
02991               } else if ((clone->common.fn_flags & ZEND_ACC_PROTECTED)) {
02992                      /* Ensure that if we're calling a protected function, we're allowed to do so.
02993                       */
02994                      if (!zend_check_protected(clone->common.scope, EG(scope))) {
02995                             zend_error_noreturn(E_ERROR, "Call to protected %s::__clone() from context '%s'", ce->name, EG(scope) ? EG(scope)->name : "");
02996                      }
02997               }
02998        }
02999 
03000        EX_T(opline->result.u.var).var.ptr_ptr = &EX_T(opline->result.u.var).var.ptr;
03001        if (!EG(exception)) {
03002               ALLOC_ZVAL(EX_T(opline->result.u.var).var.ptr);
03003               Z_OBJVAL_P(EX_T(opline->result.u.var).var.ptr) = clone_call(obj TSRMLS_CC);
03004               Z_TYPE_P(EX_T(opline->result.u.var).var.ptr) = IS_OBJECT;
03005               Z_SET_REFCOUNT_P(EX_T(opline->result.u.var).var.ptr, 1);
03006               Z_SET_ISREF_P(EX_T(opline->result.u.var).var.ptr);
03007               if (!RETURN_VALUE_USED(opline) || EG(exception)) {
03008                      zval_ptr_dtor(&EX_T(opline->result.u.var).var.ptr);
03009               }
03010        }
03011        FREE_OP1_IF_VAR();
03012        ZEND_VM_NEXT_OPCODE();
03013 }
03014 
03015 ZEND_VM_HANDLER(99, ZEND_FETCH_CONSTANT, VAR|CONST|UNUSED, CONST)
03016 {
03017        zend_op *opline = EX(opline);
03018 
03019        if (OP1_TYPE == IS_UNUSED) {
03020               /* namespaced constant */
03021               if (!zend_get_constant_ex(Z_STRVAL(opline->op2.u.constant), Z_STRLEN(opline->op2.u.constant), &EX_T(opline->result.u.var).tmp_var, NULL, opline->extended_value TSRMLS_CC)) {
03022                      if ((opline->extended_value & IS_CONSTANT_UNQUALIFIED) != 0) {
03023                             char *actual = (char *)zend_memrchr(Z_STRVAL(opline->op2.u.constant), '\\', Z_STRLEN(opline->op2.u.constant));
03024                             if(!actual) {
03025                                    actual = Z_STRVAL(opline->op2.u.constant);
03026                             } else {
03027                                    actual++;
03028                             }
03029                             /* non-qualified constant - allow text substitution */
03030                             zend_error(E_NOTICE, "Use of undefined constant %s - assumed '%s'", actual, actual);
03031                             ZVAL_STRINGL(&EX_T(opline->result.u.var).tmp_var, actual, Z_STRLEN(opline->op2.u.constant)-(actual - Z_STRVAL(opline->op2.u.constant)), 1);
03032                      } else {
03033                             zend_error_noreturn(E_ERROR, "Undefined constant '%s'",
03034                                                  Z_STRVAL(opline->op2.u.constant), Z_STRVAL(opline->op2.u.constant));
03035                      }
03036               }
03037               ZEND_VM_NEXT_OPCODE();
03038        } else {
03039               /* class constant */
03040               zend_class_entry *ce;
03041               zval **value;
03042 
03043               if (OP1_TYPE == IS_CONST) {
03044 
03045                      ce = zend_fetch_class(Z_STRVAL(opline->op1.u.constant), Z_STRLEN(opline->op1.u.constant), opline->extended_value TSRMLS_CC);
03046                      if (!ce) {
03047                             zend_error_noreturn(E_ERROR, "Undefined class constant '%s'", Z_STRVAL(opline->op2.u.constant));
03048                      }
03049               } else {
03050                      ce = EX_T(opline->op1.u.var).class_entry;
03051               }
03052 
03053               if (zend_hash_find(&ce->constants_table, Z_STRVAL(opline->op2.u.constant), Z_STRLEN(opline->op2.u.constant)+1, (void **) &value) == SUCCESS) {
03054                      if (Z_TYPE_PP(value) == IS_CONSTANT_ARRAY ||
03055                          (Z_TYPE_PP(value) & IS_CONSTANT_TYPE_MASK) == IS_CONSTANT) {
03056                             zend_class_entry *old_scope = EG(scope);
03057 
03058                             EG(scope) = ce;
03059                             zval_update_constant(value, (void *) 1 TSRMLS_CC);
03060                             EG(scope) = old_scope;
03061                      }
03062                      EX_T(opline->result.u.var).tmp_var = **value;
03063                      zval_copy_ctor(&EX_T(opline->result.u.var).tmp_var);
03064               } else {
03065                      zend_error_noreturn(E_ERROR, "Undefined class constant '%s'", Z_STRVAL(opline->op2.u.constant));
03066               }
03067 
03068               ZEND_VM_NEXT_OPCODE();
03069        }
03070 }
03071 
03072 ZEND_VM_HANDLER(72, ZEND_ADD_ARRAY_ELEMENT, CONST|TMP|VAR|CV, CONST|TMP|VAR|UNUSED|CV)
03073 {
03074        zend_op *opline = EX(opline);
03075        zend_free_op free_op1, free_op2;
03076        zval *array_ptr = &EX_T(opline->result.u.var).tmp_var;
03077        zval *expr_ptr;
03078        zval *offset=GET_OP2_ZVAL_PTR(BP_VAR_R);
03079 
03080 #if !defined(ZEND_VM_SPEC) || OP1_TYPE == IS_VAR || OP1_TYPE == IS_CV
03081        zval **expr_ptr_ptr = NULL;
03082 
03083        if (opline->extended_value) {
03084               expr_ptr_ptr=GET_OP1_ZVAL_PTR_PTR(BP_VAR_W);
03085               expr_ptr = *expr_ptr_ptr;
03086        } else {
03087               expr_ptr=GET_OP1_ZVAL_PTR(BP_VAR_R);
03088        }
03089 #else
03090        expr_ptr=GET_OP1_ZVAL_PTR(BP_VAR_R);
03091 #endif
03092 
03093        if (IS_OP1_TMP_FREE()) { /* temporary variable */
03094               zval *new_expr;
03095 
03096               ALLOC_ZVAL(new_expr);
03097               INIT_PZVAL_COPY(new_expr, expr_ptr);
03098               expr_ptr = new_expr;
03099        } else {
03100 #if !defined(ZEND_VM_SPEC) || OP1_TYPE == IS_VAR || OP1_TYPE == IS_CV
03101               if (opline->extended_value) {
03102                      SEPARATE_ZVAL_TO_MAKE_IS_REF(expr_ptr_ptr);
03103                      expr_ptr = *expr_ptr_ptr;
03104                      Z_ADDREF_P(expr_ptr);
03105               } else
03106 #endif
03107               if (OP1_TYPE == IS_CONST || PZVAL_IS_REF(expr_ptr)) {
03108                      zval *new_expr;
03109 
03110                      ALLOC_ZVAL(new_expr);
03111                      INIT_PZVAL_COPY(new_expr, expr_ptr);
03112                      expr_ptr = new_expr;
03113                      zendi_zval_copy_ctor(*expr_ptr);
03114               } else {
03115                      Z_ADDREF_P(expr_ptr);
03116               }
03117        }
03118        if (offset) {
03119               switch (Z_TYPE_P(offset)) {
03120                      case IS_DOUBLE:
03121                             zend_hash_index_update(Z_ARRVAL_P(array_ptr), zend_dval_to_lval(Z_DVAL_P(offset)), &expr_ptr, sizeof(zval *), NULL);
03122                             break;
03123                      case IS_LONG:
03124                      case IS_BOOL:
03125                             zend_hash_index_update(Z_ARRVAL_P(array_ptr), Z_LVAL_P(offset), &expr_ptr, sizeof(zval *), NULL);
03126                             break;
03127                      case IS_STRING:
03128                             zend_symtable_update(Z_ARRVAL_P(array_ptr), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, &expr_ptr, sizeof(zval *), NULL);
03129                             break;
03130                      case IS_NULL:
03131                             zend_hash_update(Z_ARRVAL_P(array_ptr), "", sizeof(""), &expr_ptr, sizeof(zval *), NULL);
03132                             break;
03133                      default:
03134                             zend_error(E_WARNING, "Illegal offset type");
03135                             zval_ptr_dtor(&expr_ptr);
03136                             /* do nothing */
03137                             break;
03138               }
03139               FREE_OP2();
03140        } else {
03141               zend_hash_next_index_insert(Z_ARRVAL_P(array_ptr), &expr_ptr, sizeof(zval *), NULL);
03142        }
03143        if (opline->extended_value) {
03144               FREE_OP1_VAR_PTR();
03145        } else {
03146               FREE_OP1_IF_VAR();
03147        }
03148        ZEND_VM_NEXT_OPCODE();
03149 }
03150 
03151 ZEND_VM_HANDLER(71, ZEND_INIT_ARRAY, CONST|TMP|VAR|UNUSED|CV, CONST|TMP|VAR|UNUSED|CV)
03152 {
03153        zend_op *opline = EX(opline);
03154 
03155        array_init(&EX_T(opline->result.u.var).tmp_var);
03156        if (OP1_TYPE == IS_UNUSED) {
03157               ZEND_VM_NEXT_OPCODE();
03158 #if !defined(ZEND_VM_SPEC) || OP1_TYPE != IS_UNUSED
03159        } else {
03160               ZEND_VM_DISPATCH_TO_HANDLER(ZEND_ADD_ARRAY_ELEMENT);
03161 #endif
03162        }
03163 }
03164 
03165 ZEND_VM_HANDLER(21, ZEND_CAST, CONST|TMP|VAR|CV, ANY)
03166 {
03167        zend_op *opline = EX(opline);
03168        zend_free_op free_op1;
03169        zval *expr = GET_OP1_ZVAL_PTR(BP_VAR_R);
03170        zval *result = &EX_T(opline->result.u.var).tmp_var;
03171 
03172        if (opline->extended_value != IS_STRING) {
03173               *result = *expr;
03174               if (!IS_OP1_TMP_FREE()) {
03175                      zendi_zval_copy_ctor(*result);
03176               }
03177        }
03178        switch (opline->extended_value) {
03179               case IS_NULL:
03180                      convert_to_null(result);
03181                      break;
03182               case IS_BOOL:
03183                      convert_to_boolean(result);
03184                      break;
03185               case IS_LONG:
03186                      convert_to_long(result);
03187                      break;
03188               case IS_DOUBLE:
03189                      convert_to_double(result);
03190                      break;
03191               case IS_STRING: {
03192                      zval var_copy;
03193                      int use_copy;
03194 
03195                      zend_make_printable_zval(expr, &var_copy, &use_copy);
03196                      if (use_copy) {
03197                             *result = var_copy;
03198                             if (IS_OP1_TMP_FREE()) {
03199                                    FREE_OP1();
03200                             }
03201                      } else {
03202                             *result = *expr;
03203                             if (!IS_OP1_TMP_FREE()) {
03204                                    zendi_zval_copy_ctor(*result);
03205                             }
03206                      }
03207                      break;
03208               }
03209               case IS_ARRAY:
03210                      convert_to_array(result);
03211                      break;
03212               case IS_OBJECT:
03213                      convert_to_object(result);
03214                      break;
03215        }
03216        FREE_OP1_IF_VAR();
03217        ZEND_VM_NEXT_OPCODE();
03218 }
03219 
03220 ZEND_VM_HANDLER(73, ZEND_INCLUDE_OR_EVAL, CONST|TMP|VAR|CV, ANY)
03221 {
03222        zend_op *opline = EX(opline);
03223        zend_op_array *new_op_array=NULL;
03224        int return_value_used;
03225        zend_free_op free_op1;
03226        zval *inc_filename = GET_OP1_ZVAL_PTR(BP_VAR_R);
03227        zval tmp_inc_filename;
03228        zend_bool failure_retval=0;
03229 
03230        if (inc_filename->type!=IS_STRING) {
03231               tmp_inc_filename = *inc_filename;
03232               zval_copy_ctor(&tmp_inc_filename);
03233               convert_to_string(&tmp_inc_filename);
03234               inc_filename = &tmp_inc_filename;
03235        }
03236 
03237        return_value_used = RETURN_VALUE_USED(opline);
03238        
03239        if (Z_LVAL(opline->op2.u.constant) != ZEND_EVAL && strlen(Z_STRVAL_P(inc_filename)) != Z_STRLEN_P(inc_filename)) {
03240               if (Z_LVAL(opline->op2.u.constant)==ZEND_INCLUDE_ONCE || Z_LVAL(opline->op2.u.constant)==ZEND_INCLUDE) {
03241                      zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
03242               } else {
03243                      zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
03244               }
03245        } else {
03246               switch (Z_LVAL(opline->op2.u.constant)) {
03247                      case ZEND_INCLUDE_ONCE:
03248                      case ZEND_REQUIRE_ONCE: {
03249                                    zend_file_handle file_handle;
03250                                    char *resolved_path;
03251 
03252                                    resolved_path = zend_resolve_path(Z_STRVAL_P(inc_filename), Z_STRLEN_P(inc_filename) TSRMLS_CC);
03253                                    if (resolved_path) {
03254                                           failure_retval = zend_hash_exists(&EG(included_files), resolved_path, strlen(resolved_path)+1);
03255                                    } else {
03256                                           resolved_path = Z_STRVAL_P(inc_filename);
03257                                    }
03258 
03259                                    if (failure_retval) {
03260                                           /* do nothing, file already included */
03261                                    } else if (SUCCESS == zend_stream_open(resolved_path, &file_handle TSRMLS_CC)) {
03262 
03263                                           if (!file_handle.opened_path) {
03264                                                  file_handle.opened_path = estrdup(resolved_path);
03265                                           }
03266 
03267                                           if (zend_hash_add_empty_element(&EG(included_files), file_handle.opened_path, strlen(file_handle.opened_path)+1)==SUCCESS) {
03268                                                  new_op_array = zend_compile_file(&file_handle, (Z_LVAL(opline->op2.u.constant)==ZEND_INCLUDE_ONCE?ZEND_INCLUDE:ZEND_REQUIRE) TSRMLS_CC);
03269                                                  zend_destroy_file_handle(&file_handle TSRMLS_CC);
03270                                           } else {
03271                                                  zend_file_handle_dtor(&file_handle TSRMLS_CC);
03272                                                  failure_retval=1;
03273                                           }
03274                                    } else {
03275                                           if (Z_LVAL(opline->op2.u.constant)==ZEND_INCLUDE_ONCE) {
03276                                                  zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
03277                                           } else {
03278                                                  zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, Z_STRVAL_P(inc_filename) TSRMLS_CC);
03279                                           }
03280                                    }
03281                                    if (resolved_path != Z_STRVAL_P(inc_filename)) {
03282                                           efree(resolved_path);
03283                                    }
03284                             }
03285                             break;
03286                      case ZEND_INCLUDE:
03287                      case ZEND_REQUIRE:
03288                             new_op_array = compile_filename(Z_LVAL(opline->op2.u.constant), inc_filename TSRMLS_CC);
03289                             break;
03290                      case ZEND_EVAL: {
03291                                    char *eval_desc = zend_make_compiled_string_description("eval()'d code" TSRMLS_CC);
03292 
03293                                    new_op_array = zend_compile_string(inc_filename, eval_desc TSRMLS_CC);
03294                                    efree(eval_desc);
03295                             }
03296                             break;
03297                      EMPTY_SWITCH_DEFAULT_CASE()
03298               }
03299        }
03300        if (inc_filename==&tmp_inc_filename) {
03301               zval_dtor(&tmp_inc_filename);
03302        }
03303        FREE_OP1();
03304        EX_T(opline->result.u.var).var.ptr_ptr = &EX_T(opline->result.u.var).var.ptr;
03305        if (new_op_array && !EG(exception)) {
03306               EX(original_return_value) = EG(return_value_ptr_ptr);
03307               EG(return_value_ptr_ptr) = return_value_used ? EX_T(opline->result.u.var).var.ptr_ptr : NULL;
03308               EG(active_op_array) = new_op_array;
03309               EX_T(opline->result.u.var).var.ptr = NULL;
03310 
03311               EX(current_object) = EX(object);
03312 
03313               EX(function_state).function = (zend_function *) new_op_array;
03314               EX(object) = NULL;
03315 
03316               if (!EG(active_symbol_table)) {
03317                      zend_rebuild_symbol_table(TSRMLS_C);
03318               }
03319 
03320               if (zend_execute == execute) {
03321                      EX(call_opline) = opline;
03322                      ZEND_VM_ENTER();
03323               } else {
03324                      zend_execute(new_op_array TSRMLS_CC);
03325               }
03326 
03327               EX(function_state).function = (zend_function *) EX(op_array);
03328               EX(object) = EX(current_object);
03329 
03330               if (return_value_used) {
03331                      if (!EX_T(opline->result.u.var).var.ptr) { /* there was no return statement */
03332                             ALLOC_ZVAL(EX_T(opline->result.u.var).var.ptr);
03333                             INIT_PZVAL(EX_T(opline->result.u.var).var.ptr);
03334                             Z_LVAL_P(EX_T(opline->result.u.var).var.ptr) = 1;
03335                             Z_TYPE_P(EX_T(opline->result.u.var).var.ptr) = IS_BOOL;
03336                      }
03337               }
03338 
03339               EG(opline_ptr) = &EX(opline);
03340               EG(active_op_array) = EX(op_array);
03341               EG(return_value_ptr_ptr) = EX(original_return_value);
03342               destroy_op_array(new_op_array TSRMLS_CC);
03343               efree(new_op_array);
03344               if (EG(exception)) {
03345                      zend_throw_exception_internal(NULL TSRMLS_CC);
03346               }
03347        } else {
03348               if (return_value_used) {
03349                      ALLOC_ZVAL(EX_T(opline->result.u.var).var.ptr);
03350                      INIT_ZVAL(*EX_T(opline->result.u.var).var.ptr);
03351                      Z_LVAL_P(EX_T(opline->result.u.var).var.ptr) = failure_retval;
03352                      Z_TYPE_P(EX_T(opline->result.u.var).var.ptr) = IS_BOOL;
03353               }
03354        }
03355        ZEND_VM_NEXT_OPCODE();
03356 }
03357 
03358 ZEND_VM_HANDLER(74, ZEND_UNSET_VAR, CONST|TMP|VAR|CV, ANY)
03359 {
03360        zend_op *opline = EX(opline);
03361        zval tmp, *varname;
03362        HashTable *target_symbol_table;
03363        zend_free_op free_op1;
03364 
03365        if (OP1_TYPE == IS_CV && (opline->extended_value & ZEND_QUICK_SET)) {
03366               if (EG(active_symbol_table)) {
03367                      zend_execute_data *ex = EX(prev_execute_data);
03368                      zend_compiled_variable *cv = &CV_DEF_OF(opline->op1.u.var);
03369 
03370                      if (zend_hash_quick_del(EG(active_symbol_table), cv->name, cv->name_len+1, cv->hash_value) == SUCCESS) {
03371                             while (ex && ex->symbol_table == EG(active_symbol_table)) {
03372                                    int i;
03373 
03374                                    if (ex->op_array) {
03375                                           for (i = 0; i < ex->op_array->last_var; i++) {
03376                                                  if (ex->op_array->vars[i].hash_value == cv->hash_value &&
03377                                                         ex->op_array->vars[i].name_len == cv->name_len &&
03378                                                         !memcmp(ex->op_array->vars[i].name, cv->name, cv->name_len)) {
03379                                                         ex->CVs[i] = NULL;
03380                                                         break;
03381                                                  }
03382                                           }
03383                                    }
03384                                    ex = ex->prev_execute_data;
03385                             }
03386                      }
03387                      EX(CVs)[opline->op1.u.var] = NULL;
03388               } else if (EX(CVs)[opline->op1.u.var]) {
03389                      zval_ptr_dtor(EX(CVs)[opline->op1.u.var]);
03390                      EX(CVs)[opline->op1.u.var] = NULL;
03391               }
03392               ZEND_VM_NEXT_OPCODE();
03393        }
03394 
03395        varname = GET_OP1_ZVAL_PTR(BP_VAR_R);
03396 
03397        if (Z_TYPE_P(varname) != IS_STRING) {
03398               tmp = *varname;
03399               zval_copy_ctor(&tmp);
03400               convert_to_string(&tmp);
03401               varname = &tmp;
03402        } else if (OP1_TYPE == IS_VAR || OP1_TYPE == IS_CV) {
03403               Z_ADDREF_P(varname);
03404        }
03405 
03406        if (opline->op2.u.EA.type == ZEND_FETCH_STATIC_MEMBER) {
03407               zend_std_unset_static_property(EX_T(opline->op2.u.var).class_entry, Z_STRVAL_P(varname), Z_STRLEN_P(varname) TSRMLS_CC);
03408        } else {
03409               ulong hash_value = zend_inline_hash_func(varname->value.str.val, varname->value.str.len+1);
03410 
03411               target_symbol_table = zend_get_target_symbol_table(opline, EX(Ts), BP_VAR_IS, varname TSRMLS_CC);
03412               if (zend_hash_quick_del(target_symbol_table, varname->value.str.val, varname->value.str.len+1, hash_value) == SUCCESS) {
03413                      zend_execute_data *ex = EXECUTE_DATA;
03414 
03415                      do {
03416                             int i;
03417 
03418                             if (ex->op_array) {
03419                                    for (i = 0; i < ex->op_array->last_var; i++) {
03420                                           if (ex->op_array->vars[i].hash_value == hash_value &&
03421                                                  ex->op_array->vars[i].name_len == varname->value.str.len &&
03422                                                  !memcmp(ex->op_array->vars[i].name, varname->value.str.val, varname->value.str.len)) {
03423                                                  ex->CVs[i] = NULL;
03424                                                  break;
03425                                           }
03426                                    }
03427                             }
03428                             ex = ex->prev_execute_data;
03429                      } while (ex && ex->symbol_table == target_symbol_table);
03430               }
03431        }
03432 
03433        if (varname == &tmp) {
03434               zval_dtor(&tmp);
03435        } else if (OP1_TYPE == IS_VAR || OP1_TYPE == IS_CV) {
03436               zval_ptr_dtor(&varname);
03437        }
03438        FREE_OP1();
03439        ZEND_VM_NEXT_OPCODE();
03440 }
03441 
03442 ZEND_VM_HANDLER(75, ZEND_UNSET_DIM, VAR|UNUSED|CV, CONST|TMP|VAR|CV)
03443 {
03444        zend_op *opline = EX(opline);
03445        zend_free_op free_op1, free_op2;
03446        zval **container = GET_OP1_OBJ_ZVAL_PTR_PTR(BP_VAR_UNSET);
03447        zval *offset;
03448 
03449        if (OP1_TYPE == IS_CV && container != &EG(uninitialized_zval_ptr)) {
03450               SEPARATE_ZVAL_IF_NOT_REF(container);
03451        }
03452        offset = GET_OP2_ZVAL_PTR(BP_VAR_R);
03453 
03454        if (OP1_TYPE != IS_VAR || container) {
03455               switch (Z_TYPE_PP(container)) {
03456                      case IS_ARRAY: {
03457                             HashTable *ht = Z_ARRVAL_PP(container);
03458 
03459                             switch (Z_TYPE_P(offset)) {
03460                                    case IS_DOUBLE:
03461                                           zend_hash_index_del(ht, zend_dval_to_lval(Z_DVAL_P(offset)));
03462                                           break;
03463                                    case IS_RESOURCE:
03464                                    case IS_BOOL:
03465                                    case IS_LONG:
03466                                           zend_hash_index_del(ht, Z_LVAL_P(offset));
03467                                           break;
03468                                    case IS_STRING:
03469                                           if (OP2_TYPE == IS_CV || OP2_TYPE == IS_VAR) {
03470                                                  Z_ADDREF_P(offset);
03471                                           }
03472                                           if (zend_symtable_del(ht, offset->value.str.val, offset->value.str.len+1) == SUCCESS &&
03473                                        ht == &EG(symbol_table)) {
03474                                                  zend_execute_data *ex;
03475                                                  ulong hash_value = zend_inline_hash_func(offset->value.str.val, offset->value.str.len+1);
03476 
03477                                                  for (ex = EXECUTE_DATA; ex; ex = ex->prev_execute_data) {
03478                                                         if (ex->op_array && ex->symbol_table == ht) {
03479                                                                int i;
03480 
03481                                                                for (i = 0; i < ex->op_array->last_var; i++) {
03482                                                                       if (ex->op_array->vars[i].hash_value == hash_value &&
03483                                                                           ex->op_array->vars[i].name_len == offset->value.str.len &&
03484                                                                           !memcmp(ex->op_array->vars[i].name, offset->value.str.val, offset->value.str.len)) {
03485                                                                              ex->CVs[i] = NULL;
03486                                                                              break;
03487                                                                       }
03488                                                                }
03489                                                         }
03490                                                  }
03491                                           }
03492                                           if (OP2_TYPE == IS_CV || OP2_TYPE == IS_VAR) {
03493                                                  zval_ptr_dtor(&offset);
03494                                           }
03495                                           break;
03496                                    case IS_NULL:
03497                                           zend_hash_del(ht, "", sizeof(""));
03498                                           break;
03499                                    default:
03500                                           zend_error(E_WARNING, "Illegal offset type in unset");
03501                                           break;
03502                             }
03503                             FREE_OP2();
03504                             break;
03505                      }
03506                      case IS_OBJECT:
03507                             if (!Z_OBJ_HT_P(*container)->unset_dimension) {
03508                                    zend_error_noreturn(E_ERROR, "Cannot use object as array");
03509                             }
03510                             if (IS_OP2_TMP_FREE()) {
03511                                    MAKE_REAL_ZVAL_PTR(offset);
03512                             }
03513                             Z_OBJ_HT_P(*container)->unset_dimension(*container, offset TSRMLS_CC);
03514                             if (IS_OP2_TMP_FREE()) {
03515                                    zval_ptr_dtor(&offset);
03516                             } else {
03517                                    FREE_OP2();
03518                             }
03519                             break;
03520                      case IS_STRING:
03521                             zend_error_noreturn(E_ERROR, "Cannot unset string offsets");
03522                             ZEND_VM_CONTINUE(); /* bailed out before */
03523                      default:
03524                             FREE_OP2();
03525                             break;
03526               }
03527        } else {
03528               FREE_OP2();
03529        }
03530        FREE_OP1_VAR_PTR();
03531 
03532        ZEND_VM_NEXT_OPCODE();
03533 }
03534 
03535 ZEND_VM_HANDLER(76, ZEND_UNSET_OBJ, VAR|UNUSED|CV, CONST|TMP|VAR|CV)
03536 {
03537        zend_op *opline = EX(opline);
03538        zend_free_op free_op1, free_op2;
03539        zval **container = GET_OP1_OBJ_ZVAL_PTR_PTR(BP_VAR_UNSET);
03540        zval *offset = GET_OP2_ZVAL_PTR(BP_VAR_R);
03541 
03542        if (OP1_TYPE != IS_VAR || container) {
03543               if (OP1_TYPE == IS_CV && container != &EG(uninitialized_zval_ptr)) {
03544                      SEPARATE_ZVAL_IF_NOT_REF(container);
03545               }
03546               if (Z_TYPE_PP(container) == IS_OBJECT) {
03547                      if (IS_OP2_TMP_FREE()) {
03548                             MAKE_REAL_ZVAL_PTR(offset);
03549                      }
03550                      if (Z_OBJ_HT_P(*container)->unset_property) {
03551                             Z_OBJ_HT_P(*container)->unset_property(*container, offset TSRMLS_CC);
03552                      } else {
03553                             zend_error(E_NOTICE, "Trying to unset property of non-object");
03554                      }
03555                      if (IS_OP2_TMP_FREE()) {
03556                             zval_ptr_dtor(&offset);
03557                      } else {
03558                             FREE_OP2();
03559                      }
03560               } else {
03561                      FREE_OP2();
03562               }
03563        } else {
03564               FREE_OP2();
03565        }
03566        FREE_OP1_VAR_PTR();
03567 
03568        ZEND_VM_NEXT_OPCODE();
03569 }
03570 
03571 ZEND_VM_HANDLER(77, ZEND_FE_RESET, CONST|TMP|VAR|CV, ANY)
03572 {
03573        zend_op *opline = EX(opline);
03574        zend_free_op free_op1;
03575        zval *array_ptr, **array_ptr_ptr;
03576        HashTable *fe_ht;
03577        zend_object_iterator *iter = NULL;
03578        zend_class_entry *ce = NULL;
03579        zend_bool is_empty = 0;
03580 
03581        if (opline->extended_value & ZEND_FE_RESET_VARIABLE) {
03582               array_ptr_ptr = GET_OP1_ZVAL_PTR_PTR(BP_VAR_R);
03583               if (array_ptr_ptr == NULL || array_ptr_ptr == &EG(uninitialized_zval_ptr)) {
03584                      ALLOC_INIT_ZVAL(array_ptr);
03585               } else if (Z_TYPE_PP(array_ptr_ptr) == IS_OBJECT) {
03586                      if(Z_OBJ_HT_PP(array_ptr_ptr)->get_class_entry == NULL) {
03587                             zend_error(E_WARNING, "foreach() cannot iterate over objects without PHP class");
03588                             ZEND_VM_JMP(EX(op_array)->opcodes+opline->op2.u.opline_num);
03589                      }
03590 
03591                      ce = Z_OBJCE_PP(array_ptr_ptr);
03592                      if (!ce || ce->get_iterator == NULL) {
03593                             SEPARATE_ZVAL_IF_NOT_REF(array_ptr_ptr);
03594                             Z_ADDREF_PP(array_ptr_ptr);
03595                      }
03596                      array_ptr = *array_ptr_ptr;
03597               } else {
03598                      if (Z_TYPE_PP(array_ptr_ptr) == IS_ARRAY) {
03599                             SEPARATE_ZVAL_IF_NOT_REF(array_ptr_ptr);
03600                             if (opline->extended_value & ZEND_FE_FETCH_BYREF) {
03601                                    Z_SET_ISREF_PP(array_ptr_ptr);
03602                             }
03603                      }
03604                      array_ptr = *array_ptr_ptr;
03605                      Z_ADDREF_P(array_ptr);
03606               }
03607        } else {
03608               array_ptr = GET_OP1_ZVAL_PTR(BP_VAR_R);
03609               if (IS_OP1_TMP_FREE()) { /* IS_TMP_VAR */
03610                      zval *tmp;
03611 
03612                      ALLOC_ZVAL(tmp);
03613                      INIT_PZVAL_COPY(tmp, array_ptr);
03614                      array_ptr = tmp;
03615                      if (Z_TYPE_P(array_ptr) == IS_OBJECT) {
03616                             ce = Z_OBJCE_P(array_ptr);
03617                             if (ce && ce->get_iterator) {
03618                                    Z_DELREF_P(array_ptr);
03619                             }
03620                      }
03621               } else if (Z_TYPE_P(array_ptr) == IS_OBJECT) {
03622                      ce = Z_OBJCE_P(array_ptr);
03623                      if (!ce || !ce->get_iterator) {
03624                             Z_ADDREF_P(array_ptr);
03625                      }
03626               } else if (OP1_TYPE == IS_CONST || 
03627                          ((OP1_TYPE == IS_CV || OP1_TYPE == IS_VAR) &&
03628                           !Z_ISREF_P(array_ptr) &&
03629                           Z_REFCOUNT_P(array_ptr) > 1)) {
03630                      zval *tmp;
03631 
03632                      ALLOC_ZVAL(tmp);
03633                      INIT_PZVAL_COPY(tmp, array_ptr);
03634                      zval_copy_ctor(tmp);
03635                      array_ptr = tmp;
03636               } else {
03637                      Z_ADDREF_P(array_ptr);
03638               }
03639        }
03640 
03641        if (ce && ce->get_iterator) {
03642               iter = ce->get_iterator(ce, array_ptr, opline->extended_value & ZEND_FE_RESET_REFERENCE TSRMLS_CC);
03643 
03644               if (iter && !EG(exception)) {
03645                      array_ptr = zend_iterator_wrap(iter TSRMLS_CC);
03646               } else {
03647                      if (opline->extended_value & ZEND_FE_RESET_VARIABLE) {
03648                             FREE_OP1_VAR_PTR();
03649                      } else {
03650                             FREE_OP1_IF_VAR();
03651                      }
03652                      if (!EG(exception)) {
03653                             zend_throw_exception_ex(NULL, 0 TSRMLS_CC, "Object of type %s did not create an Iterator", ce->name);
03654                      }
03655                      zend_throw_exception_internal(NULL TSRMLS_CC);
03656                      ZEND_VM_NEXT_OPCODE();
03657               }
03658        }
03659 
03660        AI_SET_PTR(EX_T(opline->result.u.var).var, array_ptr);
03661        PZVAL_LOCK(array_ptr);
03662 
03663        if (iter) {
03664               iter->index = 0;
03665               if (iter->funcs->rewind) {
03666                      iter->funcs->rewind(iter TSRMLS_CC);
03667                      if (EG(exception)) {
03668                             Z_DELREF_P(array_ptr);
03669                             zval_ptr_dtor(&array_ptr);
03670                             if (opline->extended_value & ZEND_FE_RESET_VARIABLE) {
03671                                    FREE_OP1_VAR_PTR();
03672                             } else {
03673                                    FREE_OP1_IF_VAR();
03674                             }
03675                             ZEND_VM_NEXT_OPCODE();
03676                      }
03677               }
03678               is_empty = iter->funcs->valid(iter TSRMLS_CC) != SUCCESS;
03679               if (EG(exception)) {
03680                      Z_DELREF_P(array_ptr);
03681                      zval_ptr_dtor(&array_ptr);
03682                      if (opline->extended_value & ZEND_FE_RESET_VARIABLE) {
03683                             FREE_OP1_VAR_PTR();
03684                      } else {
03685                             FREE_OP1_IF_VAR();
03686                      }
03687                      ZEND_VM_NEXT_OPCODE();
03688               }
03689               iter->index = -1; /* will be set to 0 before using next handler */
03690        } else if ((fe_ht = HASH_OF(array_ptr)) != NULL) {
03691               zend_hash_internal_pointer_reset(fe_ht);
03692               if (ce) {
03693                      zend_object *zobj = zend_objects_get_address(array_ptr TSRMLS_CC);
03694                      while (zend_hash_has_more_elements(fe_ht) == SUCCESS) {
03695                             char *str_key;
03696                             uint str_key_len;
03697                             ulong int_key;
03698                             zend_uchar key_type;
03699 
03700                             key_type = zend_hash_get_current_key_ex(fe_ht, &str_key, &str_key_len, &int_key, 0, NULL);
03701                             if (key_type != HASH_KEY_NON_EXISTANT &&
03702                                    (key_type == HASH_KEY_IS_LONG ||
03703                                  zend_check_property_access(zobj, str_key, str_key_len-1 TSRMLS_CC) == SUCCESS)) {
03704                                    break;
03705                             }
03706                             zend_hash_move_forward(fe_ht);
03707                      }
03708               }
03709               is_empty = zend_hash_has_more_elements(fe_ht) != SUCCESS;
03710               zend_hash_get_pointer(fe_ht, &EX_T(opline->result.u.var).fe.fe_pos);
03711        } else {
03712               zend_error(E_WARNING, "Invalid argument supplied for foreach()");
03713               is_empty = 1;
03714        }
03715 
03716        if (opline->extended_value & ZEND_FE_RESET_VARIABLE) {
03717               FREE_OP1_VAR_PTR();
03718        } else {
03719               FREE_OP1_IF_VAR();
03720        }
03721        if (is_empty) {
03722               ZEND_VM_JMP(EX(op_array)->opcodes+opline->op2.u.opline_num);
03723        } else {
03724               ZEND_VM_NEXT_OPCODE();
03725        }
03726 }
03727 
03728 ZEND_VM_HANDLER(78, ZEND_FE_FETCH, VAR, ANY)
03729 {
03730        zend_op *opline = EX(opline);
03731        zend_free_op free_op1;
03732        zval *array = EX_T(opline->op1.u.var).var.ptr;
03733        zval **value;
03734        char *str_key;
03735        uint str_key_len;
03736        ulong int_key;
03737        HashTable *fe_ht;
03738        zend_object_iterator *iter = NULL;
03739        int key_type = 0;
03740        zend_bool use_key = (zend_bool)(opline->extended_value & ZEND_FE_FETCH_WITH_KEY);
03741 
03742        switch (zend_iterator_unwrap(array, &iter TSRMLS_CC)) {
03743               default:
03744               case ZEND_ITER_INVALID:
03745                      zend_error(E_WARNING, "Invalid argument supplied for foreach()");
03746                      ZEND_VM_JMP(EX(op_array)->opcodes+opline->op2.u.opline_num);
03747 
03748               case ZEND_ITER_PLAIN_OBJECT: {
03749                      char *class_name, *prop_name;
03750                      zend_object *zobj = zend_objects_get_address(array TSRMLS_CC);
03751 
03752                      fe_ht = HASH_OF(array);
03753                      zend_hash_set_pointer(fe_ht, &EX_T(opline->op1.u.var).fe.fe_pos);
03754                      do {
03755                             if (zend_hash_get_current_data(fe_ht, (void **) &value)==FAILURE) {
03756                                    /* reached end of iteration */
03757                                    ZEND_VM_JMP(EX(op_array)->opcodes+opline->op2.u.opline_num);
03758                             }
03759                             key_type = zend_hash_get_current_key_ex(fe_ht, &str_key, &str_key_len, &int_key, 0, NULL);
03760 
03761                             zend_hash_move_forward(fe_ht);
03762                      } while (key_type == HASH_KEY_NON_EXISTANT ||
03763                               (key_type != HASH_KEY_IS_LONG &&
03764                                zend_check_property_access(zobj, str_key, str_key_len-1 TSRMLS_CC) != SUCCESS));
03765                      zend_hash_get_pointer(fe_ht, &EX_T(opline->op1.u.var).fe.fe_pos);
03766                      if (use_key && key_type != HASH_KEY_IS_LONG) {
03767                             zend_unmangle_property_name(str_key, str_key_len-1, &class_name, &prop_name);
03768                             str_key_len = strlen(prop_name);
03769                             str_key = estrndup(prop_name, str_key_len);
03770                             str_key_len++;
03771                      }
03772                      break;
03773               }
03774 
03775               case ZEND_ITER_PLAIN_ARRAY:
03776                      fe_ht = HASH_OF(array);
03777                      zend_hash_set_pointer(fe_ht, &EX_T(opline->op1.u.var).fe.fe_pos);
03778                      if (zend_hash_get_current_data(fe_ht, (void **) &value)==FAILURE) {
03779                             /* reached end of iteration */
03780                             ZEND_VM_JMP(EX(op_array)->opcodes+opline->op2.u.opline_num);
03781                      }
03782                      if (use_key) {
03783                             key_type = zend_hash_get_current_key_ex(fe_ht, &str_key, &str_key_len, &int_key, 1, NULL);
03784                      }
03785                      zend_hash_move_forward(fe_ht);
03786                      zend_hash_get_pointer(fe_ht, &EX_T(opline->op1.u.var).fe.fe_pos);
03787                      break;
03788 
03789               case ZEND_ITER_OBJECT:
03790                      /* !iter happens from exception */
03791                      if (iter && ++iter->index > 0) {
03792                             /* This could cause an endless loop if index becomes zero again.
03793                              * In case that ever happens we need an additional flag. */
03794                             iter->funcs->move_forward(iter TSRMLS_CC);
03795                             if (EG(exception)) {
03796                                    Z_DELREF_P(array);
03797                                    zval_ptr_dtor(&array);
03798                                    ZEND_VM_NEXT_OPCODE();
03799                             }
03800                      }
03801                      /* If index is zero we come from FE_RESET and checked valid() already. */
03802                      if (!iter || (iter->index > 0 && iter->funcs->valid(iter TSRMLS_CC) == FAILURE)) {
03803                             /* reached end of iteration */
03804                             if (EG(exception)) {
03805                                    Z_DELREF_P(array);
03806                                    zval_ptr_dtor(&array);
03807                                    ZEND_VM_NEXT_OPCODE();
03808                             }
03809                             ZEND_VM_JMP(EX(op_array)->opcodes+opline->op2.u.opline_num);
03810                      }
03811                      iter->funcs->get_current_data(iter, &value TSRMLS_CC);
03812                      if (EG(exception)) {
03813                             Z_DELREF_P(array);
03814                             zval_ptr_dtor(&array);
03815                             ZEND_VM_NEXT_OPCODE();
03816                      }
03817                      if (!value) {
03818                             /* failure in get_current_data */
03819                             ZEND_VM_JMP(EX(op_array)->opcodes+opline->op2.u.opline_num);
03820                      }
03821                      if (use_key) {
03822                             if (iter->funcs->get_current_key) {
03823                                    key_type = iter->funcs->get_current_key(iter, &str_key, &str_key_len, &int_key TSRMLS_CC);
03824                                    if (EG(exception)) {
03825                                           Z_DELREF_P(array);
03826                                           zval_ptr_dtor(&array);
03827                                           ZEND_VM_NEXT_OPCODE();
03828                                    }
03829                             } else {
03830                                    key_type = HASH_KEY_IS_LONG;
03831                                    int_key = iter->index;
03832                             }
03833                      }
03834                      break;
03835        }
03836 
03837        if (opline->extended_value & ZEND_FE_FETCH_BYREF) {
03838               SEPARATE_ZVAL_IF_NOT_REF(value);
03839               Z_SET_ISREF_PP(value);
03840               EX_T(opline->result.u.var).var.ptr_ptr = value;
03841               Z_ADDREF_PP(value);
03842        } else {
03843               AI_SET_PTR(EX_T(opline->result.u.var).var, *value);
03844               PZVAL_LOCK(*value);
03845        }
03846 
03847        if (use_key) {
03848               zend_op *op_data = opline+1;
03849               zval *key = &EX_T(op_data->result.u.var).tmp_var;
03850 
03851               switch (key_type) {
03852                      case HASH_KEY_IS_STRING:
03853                             Z_STRVAL_P(key) = str_key;
03854                             Z_STRLEN_P(key) = str_key_len-1;
03855                             Z_TYPE_P(key) = IS_STRING;
03856                             break;
03857                      case HASH_KEY_IS_LONG:
03858                             Z_LVAL_P(key) = int_key;
03859                             Z_TYPE_P(key) = IS_LONG;
03860                             break;
03861                      default:
03862                      case HASH_KEY_NON_EXISTANT:
03863                             ZVAL_NULL(key);
03864                             break;
03865               }
03866        }
03867 
03868        ZEND_VM_INC_OPCODE();
03869        ZEND_VM_NEXT_OPCODE();
03870 }
03871 
03872 ZEND_VM_HANDLER(114, ZEND_ISSET_ISEMPTY_VAR, CONST|TMP|VAR|CV, ANY)
03873 {
03874        zend_op *opline = EX(opline);
03875        zval **value;
03876        zend_bool isset = 1;
03877 
03878        if (OP1_TYPE == IS_CV && (opline->extended_value & ZEND_QUICK_SET)) {
03879               if (EX(CVs)[opline->op1.u.var]) {
03880                      value = EX(CVs)[opline->op1.u.var];
03881               } else if (EG(active_symbol_table)) {
03882                      zend_compiled_variable *cv = &CV_DEF_OF(opline->op1.u.var);
03883 
03884                      if (zend_hash_quick_find(EG(active_symbol_table), cv->name, cv->name_len+1, cv->hash_value, (void **) &value) == FAILURE) {
03885                             isset = 0;
03886                      }
03887               } else {             
03888                      isset = 0;
03889               }
03890        } else {
03891               HashTable *target_symbol_table;
03892               zend_free_op free_op1;
03893               zval tmp, *varname = GET_OP1_ZVAL_PTR(BP_VAR_IS);
03894 
03895               if (Z_TYPE_P(varname) != IS_STRING) {
03896                      tmp = *varname;
03897                      zval_copy_ctor(&tmp);
03898                      convert_to_string(&tmp);
03899                      varname = &tmp;
03900               }
03901 
03902               if (opline->op2.u.EA.type == ZEND_FETCH_STATIC_MEMBER) {
03903                      value = zend_std_get_static_property(EX_T(opline->op2.u.var).class_entry, Z_STRVAL_P(varname), Z_STRLEN_P(varname), 1 TSRMLS_CC);
03904                      if (!value) {
03905                             isset = 0;
03906                      }
03907               } else {
03908                      target_symbol_table = zend_get_target_symbol_table(opline, EX(Ts), BP_VAR_IS, varname TSRMLS_CC);
03909                      if (zend_hash_find(target_symbol_table, varname->value.str.val, varname->value.str.len+1, (void **) &value) == FAILURE) {
03910                             isset = 0;
03911                      }
03912               }
03913 
03914               if (varname == &tmp) {
03915                      zval_dtor(&tmp);
03916               }
03917               FREE_OP1();
03918        }
03919 
03920        Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_BOOL;
03921 
03922        switch (opline->extended_value & ZEND_ISSET_ISEMPTY_MASK) {
03923               case ZEND_ISSET:
03924                      if (isset && Z_TYPE_PP(value) == IS_NULL) {
03925                             Z_LVAL(EX_T(opline->result.u.var).tmp_var) = 0;
03926                      } else {
03927                             Z_LVAL(EX_T(opline->result.u.var).tmp_var) = isset;
03928                      }
03929                      break;
03930               case ZEND_ISEMPTY:
03931                      if (!isset || !i_zend_is_true(*value)) {
03932                             Z_LVAL(EX_T(opline->result.u.var).tmp_var) = 1;
03933                      } else {
03934                             Z_LVAL(EX_T(opline->result.u.var).tmp_var) = 0;
03935                      }
03936                      break;
03937        }
03938 
03939        ZEND_VM_NEXT_OPCODE();
03940 }
03941 
03942 ZEND_VM_HELPER_EX(zend_isset_isempty_dim_prop_obj_handler, VAR|UNUSED|CV, CONST|TMP|VAR|CV, int prop_dim)
03943 {
03944        zend_op *opline = EX(opline);
03945        zend_free_op free_op1;
03946        zval **container = GET_OP1_OBJ_ZVAL_PTR_PTR(BP_VAR_IS);
03947        zval **value = NULL;
03948        int result = 0;
03949 
03950        if (OP1_TYPE != IS_VAR || container) {
03951               zend_free_op free_op2;
03952               zval *offset = GET_OP2_ZVAL_PTR(BP_VAR_R);
03953 
03954               if (Z_TYPE_PP(container) == IS_ARRAY && !prop_dim) {
03955                      HashTable *ht;
03956                      int isset = 0;
03957 
03958                      ht = Z_ARRVAL_PP(container);
03959 
03960                      switch (Z_TYPE_P(offset)) {
03961                             case IS_DOUBLE:
03962                                    if (zend_hash_index_find(ht, zend_dval_to_lval(Z_DVAL_P(offset)), (void **) &value) == SUCCESS) {
03963                                           isset = 1;
03964                                    }
03965                                    break;
03966                             case IS_RESOURCE:
03967                             case IS_BOOL:
03968                             case IS_LONG:
03969                                    if (zend_hash_index_find(ht, Z_LVAL_P(offset), (void **) &value) == SUCCESS) {
03970                                           isset = 1;
03971                                    }
03972                                    break;
03973                             case IS_STRING:
03974                                    if (zend_symtable_find(ht, offset->value.str.val, offset->value.str.len+1, (void **) &value) == SUCCESS) {
03975                                           isset = 1;
03976                                    }
03977                                    break;
03978                             case IS_NULL:
03979                                    if (zend_hash_find(ht, "", sizeof(""), (void **) &value) == SUCCESS) {
03980                                           isset = 1;
03981                                    }
03982                                    break;
03983                             default:
03984                                    zend_error(E_WARNING, "Illegal offset type in isset or empty");
03985 
03986                                    break;
03987                      }
03988 
03989                      switch (opline->extended_value) {
03990                             case ZEND_ISSET:
03991                                    if (isset && Z_TYPE_PP(value) == IS_NULL) {
03992                                           result = 0;
03993                                    } else {
03994                                           result = isset;
03995                                    }
03996                                    break;
03997                             case ZEND_ISEMPTY:
03998                                    if (!isset || !i_zend_is_true(*value)) {
03999                                           result = 0;
04000                                    } else {
04001                                           result = 1;
04002                                    }
04003                                    break;
04004                      }
04005                      FREE_OP2();
04006               } else if (Z_TYPE_PP(container) == IS_OBJECT) {
04007                      if (IS_OP2_TMP_FREE()) {
04008                             MAKE_REAL_ZVAL_PTR(offset);
04009                      }
04010                      if (prop_dim) {
04011                             if (Z_OBJ_HT_P(*container)->has_property) {
04012                                    result = Z_OBJ_HT_P(*container)->has_property(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC);
04013                             } else {
04014                                    zend_error(E_NOTICE, "Trying to check property of non-object");
04015                                    result = 0;
04016                             }
04017                      } else {
04018                             if (Z_OBJ_HT_P(*container)->has_dimension) {
04019                                    result = Z_OBJ_HT_P(*container)->has_dimension(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC);
04020                             } else {
04021                                    zend_error(E_NOTICE, "Trying to check element of non-array");
04022                                    result = 0;
04023                             }
04024                      }
04025                      if (IS_OP2_TMP_FREE()) {
04026                             zval_ptr_dtor(&offset);
04027                      } else {
04028                             FREE_OP2();
04029                      }
04030               } else if ((*container)->type == IS_STRING && !prop_dim) { /* string offsets */
04031                      zval tmp;
04032 
04033                      if (Z_TYPE_P(offset) != IS_LONG) {
04034                             tmp = *offset;
04035                             zval_copy_ctor(&tmp);
04036                             convert_to_long(&tmp);
04037                             offset = &tmp;
04038                      }
04039                      if (Z_TYPE_P(offset) == IS_LONG) {
04040                             switch (opline->extended_value) {
04041                                    case ZEND_ISSET:
04042                                           if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container)) {
04043                                                  result = 1;
04044                                           }
04045                                           break;
04046                                    case ZEND_ISEMPTY:
04047                                           if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container) && Z_STRVAL_PP(container)[offset->value.lval] != '0') {
04048                                                  result = 1;
04049                                           }
04050                                           break;
04051                             }
04052                      }
04053                      FREE_OP2();
04054               } else {
04055                      FREE_OP2();
04056               }
04057        }
04058 
04059        Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_BOOL;
04060 
04061        switch (opline->extended_value) {
04062               case ZEND_ISSET:
04063                      Z_LVAL(EX_T(opline->result.u.var).tmp_var) = result;
04064                      break;
04065               case ZEND_ISEMPTY:
04066                      Z_LVAL(EX_T(opline->result.u.var).tmp_var) = !result;
04067                      break;
04068        }
04069 
04070        FREE_OP1_VAR_PTR();
04071 
04072        ZEND_VM_NEXT_OPCODE();
04073 }
04074 
04075 ZEND_VM_HANDLER(115, ZEND_ISSET_ISEMPTY_DIM_OBJ, VAR|UNUSED|CV, CONST|TMP|VAR|CV)
04076 {
04077        ZEND_VM_DISPATCH_TO_HELPER_EX(zend_isset_isempty_dim_prop_obj_handler, prop_dim, 0);
04078 }
04079 
04080 ZEND_VM_HANDLER(148, ZEND_ISSET_ISEMPTY_PROP_OBJ, VAR|UNUSED|CV, CONST|TMP|VAR|CV)
04081 {
04082        ZEND_VM_DISPATCH_TO_HELPER_EX(zend_isset_isempty_dim_prop_obj_handler, prop_dim, 1);
04083 }
04084 
04085 ZEND_VM_HANDLER(79, ZEND_EXIT, CONST|TMP|VAR|UNUSED|CV, ANY)
04086 {
04087 #if !defined(ZEND_VM_SPEC) || (OP1_TYPE != IS_UNUSED)
04088        zend_op *opline = EX(opline);
04089        if (OP1_TYPE != IS_UNUSED) {
04090               zend_free_op free_op1;
04091               zval *ptr = GET_OP1_ZVAL_PTR(BP_VAR_R);
04092 
04093               if (Z_TYPE_P(ptr) == IS_LONG) {
04094                      EG(exit_status) = Z_LVAL_P(ptr);
04095               } else {
04096                      zend_print_variable(ptr);
04097               }
04098               FREE_OP1();
04099        }
04100 #endif
04101        zend_bailout();
04102        ZEND_VM_NEXT_OPCODE();
04103 }
04104 
04105 ZEND_VM_HANDLER(57, ZEND_BEGIN_SILENCE, ANY, ANY)
04106 {
04107        zend_op *opline = EX(opline);
04108 
04109        Z_LVAL(EX_T(opline->result.u.var).tmp_var) = EG(error_reporting);
04110        Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_LONG;  /* shouldn't be necessary */
04111        if (EX(old_error_reporting) == NULL) {
04112               EX(old_error_reporting) = &EX_T(opline->result.u.var).tmp_var;
04113        }
04114 
04115        if (EG(error_reporting)) {
04116               zend_alter_ini_entry_ex("error_reporting", sizeof("error_reporting"), "0", 1, ZEND_INI_USER, ZEND_INI_STAGE_RUNTIME, 1 TSRMLS_CC);
04117        }
04118        ZEND_VM_NEXT_OPCODE();
04119 }
04120 
04121 ZEND_VM_HANDLER(142, ZEND_RAISE_ABSTRACT_ERROR, ANY, ANY)
04122 {
04123        zend_error_noreturn(E_ERROR, "Cannot call abstract method %s::%s()", EG(scope)->name, EX(op_array)->function_name);
04124        ZEND_VM_NEXT_OPCODE(); /* Never reached */
04125 }
04126 
04127 ZEND_VM_HANDLER(58, ZEND_END_SILENCE, TMP, ANY)
04128 {
04129        zend_op *opline = EX(opline);
04130        zval restored_error_reporting;
04131 
04132        if (!EG(error_reporting) && Z_LVAL(EX_T(opline->op1.u.var).tmp_var) != 0) {
04133               Z_TYPE(restored_error_reporting) = IS_LONG;
04134               Z_LVAL(restored_error_reporting) = Z_LVAL(EX_T(opline->op1.u.var).tmp_var);
04135               convert_to_string(&restored_error_reporting);
04136               zend_alter_ini_entry_ex("error_reporting", sizeof("error_reporting"), Z_STRVAL(restored_error_reporting), Z_STRLEN(restored_error_reporting), ZEND_INI_USER, ZEND_INI_STAGE_RUNTIME, 1 TSRMLS_CC);
04137               zendi_zval_dtor(restored_error_reporting);
04138        }
04139        if (EX(old_error_reporting) == &EX_T(opline->op1.u.var).tmp_var) {
04140               EX(old_error_reporting) = NULL;
04141        }
04142        ZEND_VM_NEXT_OPCODE();
04143 }
04144 
04145 ZEND_VM_HANDLER(152, ZEND_JMP_SET, CONST|TMP|VAR|CV, ANY)
04146 {
04147        zend_op *opline = EX(opline);
04148        zend_free_op free_op1;
04149        zval *value = GET_OP1_ZVAL_PTR(BP_VAR_R);
04150 
04151        if (i_zend_is_true(value)) {
04152               EX_T(opline->result.u.var).tmp_var = *value;
04153               zendi_zval_copy_ctor(EX_T(opline->result.u.var).tmp_var);
04154               FREE_OP1();
04155 #if DEBUG_ZEND>=2
04156               printf("Conditional jmp to %d\n", opline->op2.u.opline_num);
04157 #endif
04158               ZEND_VM_JMP(opline->op2.u.jmp_addr);
04159        }
04160 
04161        FREE_OP1();
04162        ZEND_VM_NEXT_OPCODE();
04163 }
04164 
04165 ZEND_VM_HANDLER(22, ZEND_QM_ASSIGN, CONST|TMP|VAR|CV, ANY)
04166 {
04167        zend_op *opline = EX(opline);
04168        zend_free_op free_op1;
04169        zval *value = GET_OP1_ZVAL_PTR(BP_VAR_R);
04170 
04171        EX_T(opline->result.u.var).tmp_var = *value;
04172        if (!IS_OP1_TMP_FREE()) {
04173               zval_copy_ctor(&EX_T(opline->result.u.var).tmp_var);
04174        }
04175        FREE_OP1_IF_VAR();
04176        ZEND_VM_NEXT_OPCODE();
04177 }
04178 
04179 ZEND_VM_HANDLER(101, ZEND_EXT_STMT, ANY, ANY)
04180 {
04181        if (!EG(no_extensions)) {
04182               zend_llist_apply_with_argument(&zend_extensions, (llist_apply_with_arg_func_t) zend_extension_statement_handler, EX(op_array) TSRMLS_CC);
04183        }
04184        ZEND_VM_NEXT_OPCODE();
04185 }
04186 
04187 ZEND_VM_HANDLER(102, ZEND_EXT_FCALL_BEGIN, ANY, ANY)
04188 {
04189        if (!EG(no_extensions)) {
04190               zend_llist_apply_with_argument(&zend_extensions, (llist_apply_with_arg_func_t) zend_extension_fcall_begin_handler, EX(op_array) TSRMLS_CC);
04191        }
04192        ZEND_VM_NEXT_OPCODE();
04193 }
04194 
04195 ZEND_VM_HANDLER(103, ZEND_EXT_FCALL_END, ANY, ANY)
04196 {
04197        if (!EG(no_extensions)) {
04198               zend_llist_apply_with_argument(&zend_extensions, (llist_apply_with_arg_func_t) zend_extension_fcall_end_handler, EX(op_array) TSRMLS_CC);
04199        }
04200        ZEND_VM_NEXT_OPCODE();
04201 }
04202 
04203 ZEND_VM_HANDLER(139, ZEND_DECLARE_CLASS, ANY, ANY)
04204 {
04205        zend_op *opline = EX(opline);
04206 
04207        EX_T(opline->result.u.var).class_entry = do_bind_class(opline, EG(class_table), 0 TSRMLS_CC);
04208        ZEND_VM_NEXT_OPCODE();
04209 }
04210 
04211 ZEND_VM_HANDLER(140, ZEND_DECLARE_INHERITED_CLASS, ANY, ANY)
04212 {
04213        zend_op *opline = EX(opline);
04214 
04215        EX_T(opline->result.u.var).class_entry = do_bind_inherited_class(opline, EG(class_table), EX_T(opline->extended_value).class_entry, 0 TSRMLS_CC);
04216        ZEND_VM_NEXT_OPCODE();
04217 }
04218 
04219 ZEND_VM_HANDLER(145, ZEND_DECLARE_INHERITED_CLASS_DELAYED, ANY, ANY)
04220 {
04221        zend_op *opline = EX(opline);
04222        zend_class_entry **pce, **pce_orig;
04223 
04224        if (zend_hash_find(EG(class_table), Z_STRVAL(opline->op2.u.constant), Z_STRLEN(opline->op2.u.constant)+1, (void**)&pce) == FAILURE ||
04225            (zend_hash_find(EG(class_table), Z_STRVAL(opline->op1.u.constant), Z_STRLEN(opline->op1.u.constant), (void**)&pce_orig) == SUCCESS &&
04226             *pce != *pce_orig)) {
04227               do_bind_inherited_class(opline, EG(class_table), EX_T(opline->extended_value).class_entry, 0 TSRMLS_CC);
04228        }
04229        ZEND_VM_NEXT_OPCODE();
04230 }
04231 
04232 ZEND_VM_HANDLER(141, ZEND_DECLARE_FUNCTION, ANY, ANY)
04233 {
04234        do_bind_function(EX(opline), EG(function_table), 0);
04235        ZEND_VM_NEXT_OPCODE();
04236 }
04237 
04238 ZEND_VM_HANDLER(105, ZEND_TICKS, CONST, ANY)
04239 {
04240        zend_op *opline = EX(opline);
04241 
04242        if (++EG(ticks_count)>=Z_LVAL(opline->op1.u.constant)) {
04243               EG(ticks_count)=0;
04244               if (zend_ticks_function) {
04245                      zend_ticks_function(Z_LVAL(opline->op1.u.constant));
04246               }
04247        }
04248        ZEND_VM_NEXT_OPCODE();
04249 }
04250 
04251 ZEND_VM_HANDLER(138, ZEND_INSTANCEOF, TMP|VAR|CV, ANY)
04252 {
04253        zend_op *opline = EX(opline);
04254        zend_free_op free_op1;
04255        zval *expr = GET_OP1_ZVAL_PTR(BP_VAR_R);
04256        zend_bool result;
04257 
04258        if (Z_TYPE_P(expr) == IS_OBJECT && Z_OBJ_HT_P(expr)->get_class_entry) {
04259               result = instanceof_function(Z_OBJCE_P(expr), EX_T(opline->op2.u.var).class_entry TSRMLS_CC);
04260        } else {
04261               result = 0;
04262        }
04263        ZVAL_BOOL(&EX_T(opline->result.u.var).tmp_var, result);
04264        FREE_OP1();
04265        ZEND_VM_NEXT_OPCODE();
04266 }
04267 
04268 ZEND_VM_HANDLER(104, ZEND_EXT_NOP, ANY, ANY)
04269 {
04270        ZEND_VM_NEXT_OPCODE();
04271 }
04272 
04273 ZEND_VM_HANDLER(0, ZEND_NOP, ANY, ANY)
04274 {
04275        ZEND_VM_NEXT_OPCODE();
04276 }
04277 
04278 ZEND_VM_HANDLER(144, ZEND_ADD_INTERFACE, ANY, CONST)
04279 {
04280        zend_op *opline = EX(opline);
04281        zend_class_entry *ce = EX_T(opline->op1.u.var).class_entry;
04282        zend_class_entry *iface = zend_fetch_class(Z_STRVAL(opline->op2.u.constant), Z_STRLEN(opline->op2.u.constant), opline->extended_value TSRMLS_CC);
04283 
04284        if (iface) {
04285               if (!(iface->ce_flags & ZEND_ACC_INTERFACE)) {
04286                      zend_error_noreturn(E_ERROR, "%s cannot implement %s - it is not an interface", ce->name, iface->name);
04287               }
04288               zend_do_implement_interface(ce, iface TSRMLS_CC);
04289        }
04290 
04291        ZEND_VM_NEXT_OPCODE();
04292 }
04293 
04294 ZEND_VM_HANDLER(149, ZEND_HANDLE_EXCEPTION, ANY, ANY)
04295 {
04296        zend_uint op_num = EG(opline_before_exception)-EG(active_op_array)->opcodes;
04297        int i;
04298        zend_uint catch_op_num;
04299        int catched = 0;
04300        zval restored_error_reporting;
04301  
04302        void **stack_frame = (void**)(((char*)EX(Ts)) +
04303               (ZEND_MM_ALIGNED_SIZE(sizeof(temp_variable)) * EX(op_array)->T));
04304 
04305        while (zend_vm_stack_top(TSRMLS_C) != stack_frame) {
04306               zval *stack_zval_p = zend_vm_stack_pop(TSRMLS_C);
04307               zval_ptr_dtor(&stack_zval_p);
04308        }
04309 
04310        for (i=0; i<EG(active_op_array)->last_try_catch; i++) {
04311               if (EG(active_op_array)->try_catch_array[i].try_op > op_num) {
04312                      /* further blocks will not be relevant... */
04313                      break;
04314               }
04315               if (op_num >= EG(active_op_array)->try_catch_array[i].try_op
04316                      && op_num < EG(active_op_array)->try_catch_array[i].catch_op) {
04317                      catch_op_num = EX(op_array)->try_catch_array[i].catch_op;
04318                      catched = 1;
04319               }
04320        }
04321 
04322        while (EX(fbc)) {
04323               EX(called_scope) = (zend_class_entry*)zend_ptr_stack_pop(&EG(arg_types_stack));
04324               if (EX(object)) {
04325                      if (IS_CTOR_CALL(EX(called_scope))) {
04326                             if (IS_CTOR_USED(EX(called_scope))) {
04327                                    Z_DELREF_P(EX(object));
04328                             }
04329                             if (Z_REFCOUNT_P(EX(object)) == 1) {
04330                                    zend_object_store_ctor_failed(EX(object) TSRMLS_CC);
04331                             }
04332                      }
04333                      zval_ptr_dtor(&EX(object));
04334               }
04335               EX(called_scope) = DECODE_CTOR(EX(called_scope));
04336               zend_arg_types_stack_2_pop(&EG(arg_types_stack), &EX(object), &EX(fbc));
04337        }
04338 
04339        for (i=0; i<EX(op_array)->last_brk_cont; i++) {
04340               if (EX(op_array)->brk_cont_array[i].start < 0) {
04341                      continue;
04342               } else if (EX(op_array)->brk_cont_array[i].start > op_num) {
04343                      /* further blocks will not be relevant... */
04344                      break;
04345               } else if (op_num < EX(op_array)->brk_cont_array[i].brk) {
04346                      if (!catched ||
04347                          catch_op_num >= EX(op_array)->brk_cont_array[i].brk) {
04348                             zend_op *brk_opline = &EX(op_array)->opcodes[EX(op_array)->brk_cont_array[i].brk];
04349 
04350                             switch (brk_opline->opcode) {
04351                                    case ZEND_SWITCH_FREE:
04352                                           if (brk_opline->op1.u.EA.type != EXT_TYPE_FREE_ON_RETURN) {
04353                                                  zend_switch_free(&EX_T(brk_opline->op1.u.var), brk_opline->extended_value TSRMLS_CC);
04354                                           }
04355                                           break;
04356                                    case ZEND_FREE:
04357                                           if (brk_opline->op1.u.EA.type != EXT_TYPE_FREE_ON_RETURN) {
04358                                                  zendi_zval_dtor(EX_T(brk_opline->op1.u.var).tmp_var);
04359                                           }
04360                                           break;
04361                             }
04362                      }
04363               }
04364        }
04365 
04366        /* restore previous error_reporting value */
04367        if (!EG(error_reporting) && EX(old_error_reporting) != NULL && Z_LVAL_P(EX(old_error_reporting)) != 0) {
04368               Z_TYPE(restored_error_reporting) = IS_LONG;
04369               Z_LVAL(restored_error_reporting) = Z_LVAL_P(EX(old_error_reporting));
04370               convert_to_string(&restored_error_reporting);
04371               zend_alter_ini_entry_ex("error_reporting", sizeof("error_reporting"), Z_STRVAL(restored_error_reporting), Z_STRLEN(restored_error_reporting), ZEND_INI_USER, ZEND_INI_STAGE_RUNTIME, 1 TSRMLS_CC);
04372               zendi_zval_dtor(restored_error_reporting);
04373        }
04374        EX(old_error_reporting) = NULL;
04375 
04376        if (!catched) {
04377               ZEND_VM_DISPATCH_TO_HELPER(zend_leave_helper);
04378        } else {
04379               ZEND_VM_SET_OPCODE(&EX(op_array)->opcodes[catch_op_num]);
04380               ZEND_VM_CONTINUE();
04381        }
04382 }
04383 
04384 ZEND_VM_HANDLER(146, ZEND_VERIFY_ABSTRACT_CLASS, ANY, ANY)
04385 {
04386        zend_verify_abstract_class(EX_T(EX(opline)->op1.u.var).class_entry TSRMLS_CC);
04387        ZEND_VM_NEXT_OPCODE();
04388 }
04389 
04390 ZEND_VM_HANDLER(150, ZEND_USER_OPCODE, ANY, ANY)
04391 {
04392        int ret = zend_user_opcode_handlers[EX(opline)->opcode](ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_INTERNAL);
04393 
04394        switch (ret) {
04395               case ZEND_USER_OPCODE_CONTINUE:
04396                      ZEND_VM_CONTINUE();
04397               case ZEND_USER_OPCODE_RETURN:
04398                      ZEND_VM_DISPATCH_TO_HELPER(zend_leave_helper);
04399               case ZEND_USER_OPCODE_ENTER:
04400                      ZEND_VM_ENTER();
04401               case ZEND_USER_OPCODE_LEAVE:
04402                      ZEND_VM_LEAVE();
04403               case ZEND_USER_OPCODE_DISPATCH:
04404                      ZEND_VM_DISPATCH(EX(opline)->opcode, EX(opline));
04405               default:
04406                      ZEND_VM_DISPATCH((zend_uchar)(ret & 0xff), EX(opline));
04407        }
04408 }
04409 
04410 ZEND_VM_HANDLER(143, ZEND_DECLARE_CONST, CONST, CONST)
04411 {
04412        zend_op *opline = EX(opline);
04413        zend_free_op free_op1, free_op2;
04414        zval *name  = GET_OP1_ZVAL_PTR(BP_VAR_R);
04415        zval *val   = GET_OP2_ZVAL_PTR(BP_VAR_R);
04416        zend_constant c;
04417 
04418        if ((Z_TYPE_P(val) & IS_CONSTANT_TYPE_MASK) == IS_CONSTANT || Z_TYPE_P(val) == IS_CONSTANT_ARRAY) {
04419               zval tmp = *val;
04420               zval *tmp_ptr = &tmp;
04421 
04422               if (Z_TYPE_P(val) == IS_CONSTANT_ARRAY) {
04423                      zval_copy_ctor(&tmp);
04424               }
04425               INIT_PZVAL(&tmp);
04426               zval_update_constant(&tmp_ptr, NULL TSRMLS_CC);
04427               c.value = *tmp_ptr;
04428        } else {
04429               c.value = *val;
04430               zval_copy_ctor(&c.value);
04431        }
04432        c.flags = CONST_CS; /* non persistent, case sensetive */
04433        c.name = zend_strndup(Z_STRVAL_P(name), Z_STRLEN_P(name));
04434        c.name_len = Z_STRLEN_P(name)+1;
04435        c.module_number = PHP_USER_CONSTANT;
04436 
04437        if (zend_register_constant(&c TSRMLS_CC) == FAILURE) {
04438        }
04439 
04440        FREE_OP1();
04441        FREE_OP2();
04442        ZEND_VM_NEXT_OPCODE();
04443 }
04444 
04445 ZEND_VM_HANDLER(153, ZEND_DECLARE_LAMBDA_FUNCTION, CONST, CONST)
04446 {
04447        zend_op *opline = EX(opline);
04448        zend_function *op_array;
04449 
04450        if (zend_hash_quick_find(EG(function_table), Z_STRVAL(opline->op1.u.constant), Z_STRLEN(opline->op1.u.constant), Z_LVAL(opline->op2.u.constant), (void *) &op_array) == FAILURE ||
04451            op_array->type != ZEND_USER_FUNCTION) {
04452               zend_error_noreturn(E_ERROR, "Base lambda function for closure not found");
04453        }
04454 
04455        zend_create_closure(&EX_T(opline->result.u.var).tmp_var, op_array TSRMLS_CC);
04456 
04457        ZEND_VM_NEXT_OPCODE();
04458 }
04459 
04460 ZEND_VM_EXPORT_HELPER(zend_do_fcall, zend_do_fcall_common_helper)