Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:31903 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 46300 invoked by uid 1010); 24 Aug 2007 16:55:24 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 46284 invoked from network); 24 Aug 2007 16:55:24 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 Aug 2007 16:55:24 -0000 Authentication-Results: pb1.pair.com header.from=dmitry@zend.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=dmitry@zend.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 212.25.124.162 as permitted sender) X-PHP-List-Original-Sender: dmitry@zend.com X-Host-Fingerprint: 212.25.124.162 mail.zend.com Linux 2.5 (sometimes 2.4) (4) Received: from [212.25.124.162] ([212.25.124.162:56539] helo=mail.zend.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 30/47-31863-77D0FC64 for ; Fri, 24 Aug 2007 12:55:22 -0400 Received: (qmail 26136 invoked from network); 24 Aug 2007 16:55:14 -0000 Received: from internal.zend.office (HELO thinkpad) (10.1.1.1) by internal.zend.office with SMTP; 24 Aug 2007 16:55:14 -0000 To: "'Etienne Kneuss'" , Date: Fri, 24 Aug 2007 20:55:10 +0400 Message-ID: <000001c7e66f$896bcc10$6e02a8c0@thinkpad> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_0001_01C7E691.107D6C10" X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.6626 Importance: Normal In-Reply-To: <46CEDAB1.2060204@php.net> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3138 Subject: RE: [PHP-DEV] [patch] Late static bindings (LSB) From: dmitry@zend.com ("Dmitry Stogov") References: <46CEDAB1.2060204@php.net> ------=_NextPart_000_0001_01C7E691.107D6C10 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi Etienne, We already have patch for late static binding that is very similar to = yours. If you have time, please compare them. From quick look I see that our patch more accurate (it supports = constants and runtime function calls) Does our patch miss something that your patch does? Thanks. Dmitry. > -----Original Message----- > From: Etienne Kneuss [mailto:colder@php.net]=20 > Sent: Friday, August 24, 2007 5:19 PM > To: internals@lists.php.net > Subject: [PHP-DEV] [patch] Late static bindings (LSB) >=20 >=20 > Hi internals, >=20 > here is a patch that implements Late static bindinds in a way that=20 > minimizes the performance hits that were feared. > There is no significant slowdown or memory usage increase=20 > when running=20 > Zend/bench.php, which I assume is a > good enough bench for that kind of matter, as it involves a stupid=20 > amount of (recursive) function calls. >=20 > You can also find the patch here:=20 > http://patches.colder.ch/Zend/late_static_bindings_take6.patch?markup >=20 > Here is a document that describes its usage:=20 > http://colder.ch/news/08-24-2007/28/late-static-bindings-expl.html >=20 > Regards, >=20 > --=20 > Etienne Kneuss > http://www.colder.ch >=20 > Men never do evil so completely and cheerfully as=20 > when they do it from a religious conviction. > -- Pascal >=20 >=20 ------=_NextPart_000_0001_01C7E691.107D6C10 Content-Type: text/plain; name="late-static-binding-2.diff.txt" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="late-static-binding-2.diff.txt" Index: Zend/zend_API.c=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= RCS file: /repository/ZendEngine2/zend_API.c,v=0A= retrieving revision 1.442=0A= diff -u -p -d -r1.442 zend_API.c=0A= --- Zend/zend_API.c 20 Aug 2007 09:48:41 -0000 1.442=0A= +++ Zend/zend_API.c 24 Aug 2007 16:50:13 -0000=0A= @@ -2836,6 +2836,9 @@ ZEND_API zend_bool zend_is_callable_ex(z=0A= lcname_len =3D=3D sizeof("parent")-1 &&=0A= ZEND_U_EQUAL(Z_TYPE_PP(obj), lcname, lcname_len, "parent", = sizeof("parent")-1)) {=0A= ce =3D EG(active_op_array)->scope->parent;=0A= + } else if (lcname_len =3D=3D sizeof("static")-1 &&=0A= + ZEND_U_EQUAL(Z_TYPE_PP(obj), lcname, lcname_len, "static", = sizeof("static")-1)) {=0A= + ce =3D EG(caller_scope);=0A= } else if (zend_u_lookup_class(Z_TYPE_PP(obj), Z_UNIVAL_PP(obj), = Z_UNILEN_PP(obj), &pce TSRMLS_CC) =3D=3D SUCCESS) {=0A= ce =3D *pce;=0A= }=0A= Index: Zend/zend_builtin_functions.c=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= RCS file: /repository/ZendEngine2/zend_builtin_functions.c,v=0A= retrieving revision 1.349=0A= diff -u -p -d -r1.349 zend_builtin_functions.c=0A= --- Zend/zend_builtin_functions.c 24 Aug 2007 13:50:52 -0000 1.349=0A= +++ Zend/zend_builtin_functions.c 24 Aug 2007 16:50:13 -0000=0A= @@ -43,6 +43,7 @@ static ZEND_FUNCTION(error_reporting);=0A= static ZEND_FUNCTION(define);=0A= static ZEND_FUNCTION(defined);=0A= static ZEND_FUNCTION(get_class);=0A= +static ZEND_FUNCTION(get_caller_class);=0A= static ZEND_FUNCTION(get_parent_class);=0A= static ZEND_FUNCTION(method_exists);=0A= static ZEND_FUNCTION(property_exists);=0A= @@ -103,6 +104,7 @@ static zend_function_entry builtin_funct=0A= ZEND_FE(define, NULL)=0A= ZEND_FE(defined, NULL)=0A= ZEND_FE(get_class, NULL)=0A= + ZEND_FE(get_caller_class, NULL)=0A= ZEND_FE(get_parent_class, NULL)=0A= ZEND_FE(method_exists, NULL)=0A= ZEND_FE(property_exists, NULL)=0A= @@ -614,6 +616,26 @@ ZEND_FUNCTION(get_class)=0A= }=0A= /* }}} */=0A= =0A= +/* {{{ proto string get_caller_class()=0A= + Retrieves the class name */=0A= +ZEND_FUNCTION(get_caller_class)=0A= +{=0A= + int dup;=0A= +=0A= + if (!ZEND_NUM_ARGS()) {=0A= + if (EG(caller_scope)) {=0A= + RETURN_TEXTL(EG(caller_scope)->name, EG(caller_scope)->name_length, = 1);=0A= + } else {=0A= + zend_error(E_ERROR, "get_caller_class() called from outside a = class");=0A= + }=0A= + } else {=0A= + ZEND_WRONG_PARAM_COUNT();=0A= + RETURN_FALSE;=0A= + }=0A= +}=0A= +/* }}} */=0A= +=0A= +=0A= /* {{{ proto string get_parent_class([mixed object]) U=0A= Retrieves the parent class name for object or class or current = scope. */=0A= ZEND_FUNCTION(get_parent_class)=0A= Index: Zend/zend_compile.c=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= RCS file: /repository/ZendEngine2/zend_compile.c,v=0A= retrieving revision 1.765=0A= diff -u -p -d -r1.765 zend_compile.c=0A= --- Zend/zend_compile.c 24 Aug 2007 13:50:52 -0000 1.765=0A= +++ Zend/zend_compile.c 24 Aug 2007 16:50:13 -0000=0A= @@ -1702,6 +1702,7 @@ void zend_do_fetch_class(znode *result, =0A= switch (fetch_type) {=0A= case ZEND_FETCH_CLASS_SELF:=0A= case ZEND_FETCH_CLASS_PARENT:=0A= + case ZEND_FETCH_CLASS_STATIC:=0A= SET_UNUSED(opline->op2);=0A= opline->extended_value =3D fetch_type;=0A= zval_dtor(&class_name->u.constant);=0A= @@ -3220,6 +3221,9 @@ void zend_do_begin_class_declaration(zno=0A= case ZEND_FETCH_CLASS_PARENT:=0A= zend_error(E_COMPILE_ERROR, "Cannot use 'parent' as class name as = it is reserved");=0A= break;=0A= + case ZEND_FETCH_CLASS_STATIC:=0A= + zend_error(E_COMPILE_ERROR, "Cannot use 'static' as class name as = it is reserved");=0A= + break;=0A= default:=0A= break;=0A= }=0A= @@ -3332,6 +3336,9 @@ void zend_do_implements_interface(znode =0A= case ZEND_FETCH_CLASS_PARENT:=0A= zend_error(E_COMPILE_ERROR, "Cannot use 'parent' as interface name = as it is reserved");=0A= break;=0A= + case ZEND_FETCH_CLASS_STATIC:=0A= + zend_error(E_COMPILE_ERROR, "Cannot use 'static' as interface name = as it is reserved");=0A= + break;=0A= default:=0A= if (CG(active_op_array)->last > 0) {=0A= opline =3D = &CG(active_op_array)->opcodes[CG(active_op_array)->last-1];=0A= @@ -4868,6 +4875,9 @@ int zend_get_class_fetch_type(zend_uchar=0A= } else if ((class_name_len =3D=3D sizeof("parent")-1) &&=0A= ZEND_U_EQUAL(type, class_name, class_name_len, "parent", = sizeof("parent")-1)) {=0A= return ZEND_FETCH_CLASS_PARENT;=0A= + } else if ((class_name_len =3D=3D sizeof("static")-1) &&=0A= + ZEND_U_EQUAL(type, class_name, class_name_len, "static", = sizeof("static")-1)) {=0A= + return ZEND_FETCH_CLASS_STATIC;=0A= } else {=0A= return ZEND_FETCH_CLASS_DEFAULT;=0A= }=0A= Index: Zend/zend_compile.h=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= RCS file: /repository/ZendEngine2/zend_compile.h,v=0A= retrieving revision 1.364=0A= diff -u -p -d -r1.364 zend_compile.h=0A= --- Zend/zend_compile.h 24 Aug 2007 13:50:52 -0000 1.364=0A= +++ Zend/zend_compile.h 24 Aug 2007 16:50:14 -0000=0A= @@ -300,6 +300,7 @@ struct _zend_execute_data {=0A= struct _zend_op *opline;=0A= zend_function_state function_state;=0A= zend_function *fbc; /* Function Being Called */=0A= + zend_class_entry *caller_scope;=0A= zend_op_array *op_array;=0A= zval *object;=0A= union _temp_variable *Ts;=0A= @@ -632,6 +633,7 @@ int zendlex(znode *zendlval TSRMLS_DC);=0A= #define ZEND_FETCH_CLASS_GLOBAL 4=0A= #define ZEND_FETCH_CLASS_AUTO 5=0A= #define ZEND_FETCH_CLASS_INTERFACE 6=0A= +#define ZEND_FETCH_CLASS_STATIC 7=0A= #define ZEND_FETCH_CLASS_FLAGS 0xF0=0A= #define ZEND_FETCH_CLASS_NO_NORMALIZE 0x10=0A= #define ZEND_FETCH_CLASS_RT_NS_CHECK 0x20=0A= Index: Zend/zend_constants.c=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= RCS file: /repository/ZendEngine2/zend_constants.c,v=0A= retrieving revision 1.98=0A= diff -u -p -d -r1.98 zend_constants.c=0A= --- Zend/zend_constants.c 24 Aug 2007 13:50:52 -0000 1.98=0A= +++ Zend/zend_constants.c 24 Aug 2007 16:50:14 -0000=0A= @@ -382,6 +382,14 @@ ZEND_API int zend_u_get_constant_ex(zend=0A= ce =3D &scope->parent;=0A= }=0A= efree(lcname.v);=0A= + } else if (lcname_len =3D=3D sizeof("static")-1 &&=0A= + ZEND_U_EQUAL(type, lcname, lcname_len, "static", = sizeof("static")-1)) {=0A= + if (EG(caller_scope)) {=0A= + ce =3D &EG(caller_scope);=0A= + } else {=0A= + zend_error(E_ERROR, "Cannot access static:: when no class scope is = active");=0A= + }=0A= + efree(lcname.v);=0A= } else {=0A= /* Check for namespace constant */=0A= zstr nsname;=0A= Index: Zend/zend_execute_API.c=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= RCS file: /repository/ZendEngine2/zend_execute_API.c,v=0A= retrieving revision 1.413=0A= diff -u -p -d -r1.413 zend_execute_API.c=0A= --- Zend/zend_execute_API.c 24 Aug 2007 13:50:52 -0000 1.413=0A= +++ Zend/zend_execute_API.c 24 Aug 2007 16:50:14 -0000=0A= @@ -201,6 +201,7 @@ void init_executor(TSRMLS_D) /* {{{ */=0A= EG(exception) =3D NULL;=0A= =0A= EG(scope) =3D NULL;=0A= + EG(caller_scope) =3D NULL;=0A= =0A= EG(This) =3D NULL;=0A= =0A= @@ -677,6 +678,7 @@ int zend_call_function(zend_fcall_info *=0A= zend_op_array *original_op_array;=0A= zend_op **original_opline_ptr;=0A= zend_class_entry *current_scope;=0A= + zend_class_entry *current_caller_scope;=0A= zend_class_entry *calling_scope =3D NULL;=0A= zend_class_entry *check_scope_or_static =3D NULL;=0A= zval *current_this;=0A= @@ -785,6 +787,15 @@ int zend_call_function(zend_fcall_info *=0A= found =3D (*ce !=3D NULL?SUCCESS:FAILURE);=0A= fci->object_pp =3D EG(This)?&EG(This):NULL;=0A= EX(object) =3D EG(This);=0A= + } else if (Z_UNILEN_PP(fci->object_pp) =3D=3D sizeof("static")-1 &&=0A= + ZEND_U_EQUAL(Z_TYPE_PP(fci->object_pp), = Z_UNIVAL_PP(fci->object_pp), Z_UNILEN_PP(fci->object_pp), "static", = sizeof("static")-1)) {=0A= + if (!EG(caller_scope)) {=0A= + zend_error(E_ERROR, "Cannot access static:: when no class scope = is active");=0A= + }=0A= + ce =3D &(EG(caller_scope));=0A= + found =3D (*ce !=3D NULL?SUCCESS:FAILURE);=0A= + fci->object_pp =3D EG(This)?&EG(This):NULL;=0A= + EX(object) =3D EG(This);=0A= } else {=0A= zend_class_entry *scope;=0A= scope =3D EG(active_op_array) ? EG(active_op_array)->scope : NULL;=0A= @@ -853,6 +864,9 @@ int zend_call_function(zend_fcall_info *=0A= } else if (calling_scope && clen =3D=3D sizeof("parent") - 1 && =0A= ZEND_U_EQUAL(Z_TYPE_P(fci->function_name), lcname, clen, = "parent", sizeof("parent")-1)) {=0A= ce_child =3D EG(active_op_array) && EG(active_op_array)->scope ? = EG(scope)->parent : NULL;=0A= + } else if (clen =3D=3D sizeof("static") - 1 && =0A= + ZEND_U_EQUAL(Z_TYPE_P(fci->function_name), lcname, clen, = "static", sizeof("static")-1)) {=0A= + ce_child =3D EG(caller_scope);=0A= } else if (zend_u_lookup_class_ex(Z_TYPE_P(fci->function_name), = lcname, clen, 1, 0, &pce TSRMLS_CC) =3D=3D SUCCESS) {=0A= ce_child =3D *pce;=0A= }=0A= @@ -1029,6 +1043,16 @@ int zend_call_function(zend_fcall_info *=0A= =0A= current_this =3D EG(This);=0A= =0A= + current_caller_scope =3D EG(caller_scope);=0A= + if (calling_scope) {=0A= + if (!EG(caller_scope) || !EX(object) ||=0A= + !instanceof_function(EG(caller_scope), calling_scope TSRMLS_CC)) {=0A= + EG(caller_scope) =3D calling_scope;=0A= + }=0A= + } else if (EX(function_state).function->type !=3D = ZEND_INTERNAL_FUNCTION) {=0A= + EG(caller_scope) =3D NULL;=0A= + }=0A= + =0A= if (fci->object_pp) {=0A= if ((EX(function_state).function->common.fn_flags & ZEND_ACC_STATIC)) = {=0A= EG(This) =3D NULL;=0A= @@ -1110,6 +1134,7 @@ int zend_call_function(zend_fcall_info *=0A= if (EG(This)) {=0A= zval_ptr_dtor(&EG(This));=0A= }=0A= + EG(caller_scope) =3D current_caller_scope;=0A= EG(scope) =3D current_scope;=0A= EG(This) =3D current_this;=0A= EG(current_execute_data) =3D EX(prev_execute_data);=0A= @@ -1680,6 +1705,11 @@ check_fetch_type:=0A= zend_error(E_ERROR, "Cannot access parent:: when current class = scope has no parent");=0A= }=0A= return EG(scope)->parent;=0A= + case ZEND_FETCH_CLASS_STATIC:=0A= + if (!EG(caller_scope)) {=0A= + zend_error(E_ERROR, "Cannot access static:: when no class scope is = active");=0A= + }=0A= + return EG(caller_scope);=0A= case ZEND_FETCH_CLASS_AUTO: {=0A= if (do_normalize) {=0A= lcname =3D zend_u_str_case_fold(type, class_name, class_name_len, = 1, &class_name_len);=0A= Index: Zend/zend_globals.h=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= RCS file: /repository/ZendEngine2/zend_globals.h,v=0A= retrieving revision 1.168=0A= diff -u -p -d -r1.168 zend_globals.h=0A= --- Zend/zend_globals.h 12 Jul 2007 09:23:48 -0000 1.168=0A= +++ Zend/zend_globals.h 24 Aug 2007 16:50:14 -0000=0A= @@ -185,6 +185,7 @@ struct _zend_executor_globals {=0A= HashTable *zend_constants; /* constants table */=0A= =0A= zend_class_entry *scope;=0A= + zend_class_entry *caller_scope; /* Scope of the calling class */=0A= =0A= zval *This;=0A= =0A= Index: Zend/zend_language_parser.y=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= RCS file: /repository/ZendEngine2/zend_language_parser.y,v=0A= retrieving revision 1.189=0A= diff -u -p -d -r1.189 zend_language_parser.y=0A= --- Zend/zend_language_parser.y 24 Aug 2007 13:50:52 -0000 1.189=0A= +++ Zend/zend_language_parser.y 24 Aug 2007 16:50:14 -0000=0A= @@ -670,6 +670,7 @@ function_call:=0A= =0A= fully_qualified_class_name:=0A= T_STRING { $$ =3D $1; }=0A= + | T_STATIC { $$.op_type =3D IS_CONST; = ZVAL_ASCII_STRINGL(&$$.u.constant, "static", sizeof("static")-1, 1);}=0A= | T_PAAMAYIM_NEKUDOTAYIM T_STRING { zend_do_build_namespace_name(&$$, = NULL, &$2 TSRMLS_CC); }=0A= | fully_qualified_class_name T_PAAMAYIM_NEKUDOTAYIM T_STRING { = zend_do_build_namespace_name(&$$, &$1, &$3 TSRMLS_CC); }=0A= ;=0A= Index: Zend/zend_ptr_stack.h=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= RCS file: /repository/ZendEngine2/zend_ptr_stack.h,v=0A= retrieving revision 1.26=0A= diff -u -p -d -r1.26 zend_ptr_stack.h=0A= --- Zend/zend_ptr_stack.h 1 Jan 2007 09:29:21 -0000 1.26=0A= +++ Zend/zend_ptr_stack.h 24 Aug 2007 16:50:14 -0000=0A= @@ -52,9 +52,9 @@ END_EXTERN_C()=0A= =0A= /* Not doing this with a macro because of the loop unrolling in the = element assignment.=0A= Just using a macro for 3 in the body for readability sake. */=0A= -static inline void zend_ptr_stack_3_push(zend_ptr_stack *stack, void = *a, void *b, void *c)=0A= +static inline void zend_ptr_stack_4_push(zend_ptr_stack *stack, void = *a, void *b, void *c, void *d)=0A= {=0A= -#define ZEND_PTR_STACK_NUM_ARGS 3=0A= +#define ZEND_PTR_STACK_NUM_ARGS 4=0A= =0A= ZEND_PTR_STACK_RESIZE_IF_NEEDED(stack, ZEND_PTR_STACK_NUM_ARGS)=0A= =0A= @@ -62,6 +62,7 @@ static inline void zend_ptr_stack_3_push=0A= *(stack->top_element++) =3D a;=0A= *(stack->top_element++) =3D b;=0A= *(stack->top_element++) =3D c;=0A= + *(stack->top_element++) =3D d;=0A= =0A= #undef ZEND_PTR_STACK_NUM_ARGS=0A= }=0A= Index: Zend/zend_vm_def.h=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= RCS file: /repository/ZendEngine2/zend_vm_def.h,v=0A= retrieving revision 1.179=0A= diff -u -p -d -r1.179 zend_vm_def.h=0A= --- Zend/zend_vm_def.h 24 Aug 2007 13:50:52 -0000 1.179=0A= +++ Zend/zend_vm_def.h 24 Aug 2007 16:50:15 -0000=0A= @@ -1736,7 +1736,7 @@ ZEND_VM_HANDLER(112, ZEND_INIT_METHOD_CA=0A= /* FIXME: type is default */=0A= zend_uchar type =3D UG(unicode)?IS_UNICODE:IS_STRING;=0A= =0A= - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), NULL);=0A= + zend_ptr_stack_4_push(&EG(arg_types_stack), EX(fbc), EX(object), = EX(caller_scope), NULL);=0A= =0A= function_name =3D GET_OP2_ZVAL_PTR(BP_VAR_R);=0A= =0A= @@ -1763,6 +1763,8 @@ ZEND_VM_HANDLER(112, ZEND_INIT_METHOD_CA=0A= zend_error_noreturn(E_ERROR, "Call to a member function %R() on a = non-object", Z_TYPE_P(function_name), function_name_strval);=0A= }=0A= =0A= + EX(caller_scope) =3D Z_OBJCE_P(EX(object));=0A= +=0A= if (EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) {=0A= EX(object) =3D NULL;=0A= } else {=0A= @@ -1789,7 +1791,7 @@ ZEND_VM_HANDLER(113, ZEND_INIT_STATIC_ME=0A= zval *function_name;=0A= zend_class_entry *ce;=0A= =0A= - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), NULL);=0A= + zend_ptr_stack_4_push(&EG(arg_types_stack), EX(fbc), EX(object), = EX(caller_scope), NULL);=0A= =0A= if (OP1_TYPE =3D=3D IS_CONST && OP2_TYPE =3D=3D IS_CONST) {=0A= /* try a function in namespace */=0A= @@ -1848,6 +1850,13 @@ ZEND_VM_HANDLER(113, ZEND_INIT_STATIC_ME=0A= EX(fbc) =3D ce->constructor;=0A= }=0A= =0A= + if (EG(caller_scope) &&=0A= + instanceof_function(EG(caller_scope), ce TSRMLS_CC)) {=0A= + EX(caller_scope) =3D EG(caller_scope);=0A= + } else {=0A= + EX(caller_scope) =3D ce; =0A= + }=0A= +=0A= if (EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) {=0A= EX(object) =3D NULL;=0A= } else {=0A= @@ -1862,6 +1871,7 @@ ZEND_VM_HANDLER(113, ZEND_INIT_STATIC_ME=0A= }=0A= if ((EX(object) =3D EG(This))) {=0A= EX(object)->refcount++;=0A= + EX(caller_scope) =3D Z_OBJCE_P(EX(object));=0A= }=0A= }=0A= =0A= @@ -1877,7 +1887,7 @@ ZEND_VM_HANDLER(59, ZEND_INIT_FCALL_BY_N=0A= unsigned int function_name_strlen, lcname_len;=0A= zend_free_op free_op2;=0A= =0A= - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), NULL);=0A= + zend_ptr_stack_4_push(&EG(arg_types_stack), EX(fbc), EX(object), = EX(caller_scope), NULL);=0A= =0A= if (OP2_TYPE =3D=3D IS_CONST) {=0A= function_name =3D &opline->op2.u.constant;=0A= @@ -1955,6 +1965,7 @@ ZEND_VM_HELPER(zend_do_fcall_common_help=0A= zend_op *opline =3D EX(opline);=0A= zval **original_return_value;=0A= zend_class_entry *current_scope =3D NULL;=0A= + zend_class_entry *current_caller_scope;=0A= zval *current_this =3D NULL;=0A= int return_value_used =3D RETURN_VALUE_USED(opline);=0A= zend_bool should_change_scope;=0A= @@ -1991,6 +2002,7 @@ ZEND_VM_HELPER(zend_do_fcall_common_help=0A= =0A= EX_T(opline->result.u.var).var.fcall_returned_reference =3D 0;=0A= =0A= + current_caller_scope =3D EG(caller_scope);=0A= if (EX(function_state).function->common.scope) {=0A= if (!EG(This) && !(EX(function_state).function->common.fn_flags & = ZEND_ACC_STATIC)) {=0A= int severity;=0A= @@ -2005,7 +2017,11 @@ ZEND_VM_HELPER(zend_do_fcall_common_help=0A= /* FIXME: output identifiers properly */=0A= zend_error(severity, "Non-static method %v::%v() %s be called = statically", EX(function_state).function->common.scope->name, = EX(function_state).function->common.function_name, severity_word);=0A= }=0A= + EG(caller_scope) =3D EX(caller_scope);=0A= + } else if (EX(function_state).function->type !=3D = ZEND_INTERNAL_FUNCTION) {=0A= + EG(caller_scope) =3D NULL;=0A= }=0A= +=0A= if (EX(function_state).function->type =3D=3D ZEND_INTERNAL_FUNCTION) {=0A= unsigned char return_reference =3D = EX(function_state).function->common.return_reference;=0A= =0A= @@ -2126,11 +2142,12 @@ ZEND_VM_HELPER(zend_do_fcall_common_help=0A= }=0A= }=0A= =0A= + EG(caller_scope) =3D current_caller_scope;=0A= if (should_change_scope) {=0A= EG(This) =3D current_this;=0A= EG(scope) =3D current_scope;=0A= }=0A= - zend_ptr_stack_2_pop(&EG(arg_types_stack), (void**)&EX(object), = (void**)&EX(fbc));=0A= + zend_ptr_stack_3_pop(&EG(arg_types_stack), (void*)&EX(caller_scope), = (void**)&EX(object), (void**)&EX(fbc));=0A= =0A= EX(function_state).function =3D (zend_function *) EX(op_array);=0A= EG(function_state_ptr) =3D &EX(function_state);=0A= @@ -2158,7 +2175,7 @@ ZEND_VM_HANDLER(60, ZEND_DO_FCALL, CONST=0A= zend_free_op free_op1;=0A= zval *fname =3D GET_OP1_ZVAL_PTR(BP_VAR_R);=0A= =0A= - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), NULL);=0A= + zend_ptr_stack_4_push(&EG(arg_types_stack), EX(fbc), EX(object), = EX(caller_scope), NULL);=0A= =0A= if (zend_u_hash_find(EG(function_table), Z_TYPE_P(fname), = Z_UNIVAL_P(fname), Z_UNILEN_P(fname)+1, (void **) = &EX(function_state).function)=3D=3DFAILURE) {=0A= /* FIXME: output identifiers properly */=0A= @@ -2629,11 +2646,12 @@ ZEND_VM_HANDLER(68, ZEND_NEW, ANY, ANY)=0A= EX_T(opline->result.u.var).var.ptr_ptr =3D = &EX_T(opline->result.u.var).var.ptr;=0A= EX_T(opline->result.u.var).var.ptr =3D object_zval;=0A= =0A= - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), = opline);=0A= + zend_ptr_stack_4_push(&EG(arg_types_stack), EX(fbc), EX(object), = EX(caller_scope), opline);=0A= =0A= /* We are not handling overloaded classes right now */=0A= EX(object) =3D object_zval;=0A= EX(fbc) =3D constructor;=0A= + EX(caller_scope) =3D EX_T(opline->op1.u.var).class_entry;=0A= =0A= ZEND_VM_NEXT_OPCODE();=0A= }=0A= @@ -4030,7 +4048,7 @@ ZEND_VM_HANDLER(149, ZEND_HANDLE_EXCEPTI=0A= }=0A= zval_ptr_dtor(&EX(object));=0A= }=0A= - zend_ptr_stack_2_pop(&EG(arg_types_stack), (void**)&EX(object), = (void**)&EX(fbc));=0A= + zend_ptr_stack_3_pop(&EG(arg_types_stack), (void*)&EX(caller_scope), = (void**)&EX(object), (void**)&EX(fbc));=0A= }=0A= =0A= for (i=3D0; ilast_brk_cont; i++) {=0A= Index: Zend/zend_vm_execute.h=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= RCS file: /repository/ZendEngine2/zend_vm_execute.h,v=0A= retrieving revision 1.183=0A= diff -u -p -d -r1.183 zend_vm_execute.h=0A= --- Zend/zend_vm_execute.h 24 Aug 2007 13:50:52 -0000 1.183=0A= +++ Zend/zend_vm_execute.h 24 Aug 2007 16:50:17 -0000=0A= @@ -42,6 +42,7 @@ ZEND_API void execute(zend_op_array *op_=0A= =0A= /* Initialize execute_data */=0A= EX(fbc) =3D NULL;=0A= + EX(caller_scope) =3D NULL;=0A= EX(object) =3D NULL;=0A= EX(old_error_reporting) =3D NULL;=0A= if (op_array->T < TEMP_VAR_STACK_LIMIT) {=0A= @@ -134,6 +135,7 @@ static int zend_do_fcall_common_helper_S=0A= zend_op *opline =3D EX(opline);=0A= zval **original_return_value;=0A= zend_class_entry *current_scope =3D NULL;=0A= + zend_class_entry *current_caller_scope;=0A= zval *current_this =3D NULL;=0A= int return_value_used =3D RETURN_VALUE_USED(opline);=0A= zend_bool should_change_scope;=0A= @@ -170,6 +172,7 @@ static int zend_do_fcall_common_helper_S=0A= =0A= EX_T(opline->result.u.var).var.fcall_returned_reference =3D 0;=0A= =0A= + current_caller_scope =3D EG(caller_scope);=0A= if (EX(function_state).function->common.scope) {=0A= if (!EG(This) && !(EX(function_state).function->common.fn_flags & = ZEND_ACC_STATIC)) {=0A= int severity;=0A= @@ -184,7 +187,11 @@ static int zend_do_fcall_common_helper_S=0A= /* FIXME: output identifiers properly */=0A= zend_error(severity, "Non-static method %v::%v() %s be called = statically", EX(function_state).function->common.scope->name, = EX(function_state).function->common.function_name, severity_word);=0A= }=0A= + EG(caller_scope) =3D EX(caller_scope);=0A= + } else if (EX(function_state).function->type !=3D = ZEND_INTERNAL_FUNCTION) {=0A= + EG(caller_scope) =3D NULL;=0A= }=0A= +=0A= if (EX(function_state).function->type =3D=3D ZEND_INTERNAL_FUNCTION) {=0A= unsigned char return_reference =3D = EX(function_state).function->common.return_reference;=0A= =0A= @@ -305,11 +312,12 @@ static int zend_do_fcall_common_helper_S=0A= }=0A= }=0A= =0A= + EG(caller_scope) =3D current_caller_scope;=0A= if (should_change_scope) {=0A= EG(This) =3D current_this;=0A= EG(scope) =3D current_scope;=0A= }=0A= - zend_ptr_stack_2_pop(&EG(arg_types_stack), (void**)&EX(object), = (void**)&EX(fbc));=0A= + zend_ptr_stack_3_pop(&EG(arg_types_stack), (void*)&EX(caller_scope), = (void**)&EX(object), (void**)&EX(fbc));=0A= =0A= EX(function_state).function =3D (zend_function *) EX(op_array);=0A= EG(function_state_ptr) =3D &EX(function_state);=0A= @@ -431,11 +439,12 @@ static int ZEND_NEW_SPEC_HANDLER(ZEND_OP=0A= EX_T(opline->result.u.var).var.ptr_ptr =3D = &EX_T(opline->result.u.var).var.ptr;=0A= EX_T(opline->result.u.var).var.ptr =3D object_zval;=0A= =0A= - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), = opline);=0A= + zend_ptr_stack_4_push(&EG(arg_types_stack), EX(fbc), EX(object), = EX(caller_scope), opline);=0A= =0A= /* We are not handling overloaded classes right now */=0A= EX(object) =3D object_zval;=0A= EX(fbc) =3D constructor;=0A= + EX(caller_scope) =3D EX_T(opline->op1.u.var).class_entry;=0A= =0A= ZEND_VM_NEXT_OPCODE();=0A= }=0A= @@ -572,7 +581,7 @@ static int ZEND_HANDLE_EXCEPTION_SPEC_HA=0A= }=0A= zval_ptr_dtor(&EX(object));=0A= }=0A= - zend_ptr_stack_2_pop(&EG(arg_types_stack), (void**)&EX(object), = (void**)&EX(fbc));=0A= + zend_ptr_stack_3_pop(&EG(arg_types_stack), (void*)&EX(caller_scope), = (void**)&EX(object), (void**)&EX(fbc));=0A= }=0A= =0A= for (i=3D0; ilast_brk_cont; i++) {=0A= @@ -676,7 +685,7 @@ static int ZEND_INIT_FCALL_BY_NAME_SPEC_=0A= unsigned int function_name_strlen, lcname_len;=0A= =0A= =0A= - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), NULL);=0A= + zend_ptr_stack_4_push(&EG(arg_types_stack), EX(fbc), EX(object), = EX(caller_scope), NULL);=0A= =0A= if (IS_CONST =3D=3D IS_CONST) {=0A= function_name =3D &opline->op2.u.constant;=0A= @@ -874,7 +883,7 @@ static int ZEND_INIT_FCALL_BY_NAME_SPEC_=0A= unsigned int function_name_strlen, lcname_len;=0A= zend_free_op free_op2;=0A= =0A= - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), NULL);=0A= + zend_ptr_stack_4_push(&EG(arg_types_stack), EX(fbc), EX(object), = EX(caller_scope), NULL);=0A= =0A= if (IS_TMP_VAR =3D=3D IS_CONST) {=0A= function_name =3D &opline->op2.u.constant;=0A= @@ -987,7 +996,7 @@ static int ZEND_INIT_FCALL_BY_NAME_SPEC_=0A= unsigned int function_name_strlen, lcname_len;=0A= zend_free_op free_op2;=0A= =0A= - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), NULL);=0A= + zend_ptr_stack_4_push(&EG(arg_types_stack), EX(fbc), EX(object), = EX(caller_scope), NULL);=0A= =0A= if (IS_VAR =3D=3D IS_CONST) {=0A= function_name =3D &opline->op2.u.constant;=0A= @@ -1129,7 +1138,7 @@ static int ZEND_INIT_FCALL_BY_NAME_SPEC_=0A= unsigned int function_name_strlen, lcname_len;=0A= =0A= =0A= - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), NULL);=0A= + zend_ptr_stack_4_push(&EG(arg_types_stack), EX(fbc), EX(object), = EX(caller_scope), NULL);=0A= =0A= if (IS_CV =3D=3D IS_CONST) {=0A= function_name =3D &opline->op2.u.constant;=0A= @@ -1501,7 +1510,7 @@ static int ZEND_DO_FCALL_SPEC_CONST_HAND=0A= =0A= zval *fname =3D &opline->op1.u.constant;=0A= =0A= - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), NULL);=0A= + zend_ptr_stack_4_push(&EG(arg_types_stack), EX(fbc), EX(object), = EX(caller_scope), NULL);=0A= =0A= if (zend_u_hash_find(EG(function_table), Z_TYPE_P(fname), = Z_UNIVAL_P(fname), Z_UNILEN_P(fname)+1, (void **) = &EX(function_state).function)=3D=3DFAILURE) {=0A= /* FIXME: output identifiers properly */=0A= @@ -2541,7 +2550,7 @@ static int ZEND_INIT_STATIC_METHOD_CALL_=0A= zval *function_name;=0A= zend_class_entry *ce;=0A= =0A= - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), NULL);=0A= + zend_ptr_stack_4_push(&EG(arg_types_stack), EX(fbc), EX(object), = EX(caller_scope), NULL);=0A= =0A= if (IS_CONST =3D=3D IS_CONST && IS_CONST =3D=3D IS_CONST) {=0A= /* try a function in namespace */=0A= @@ -2600,6 +2609,13 @@ static int ZEND_INIT_STATIC_METHOD_CALL_=0A= EX(fbc) =3D ce->constructor;=0A= }=0A= =0A= + if (EG(caller_scope) &&=0A= + instanceof_function(EG(caller_scope), ce TSRMLS_CC)) {=0A= + EX(caller_scope) =3D EG(caller_scope);=0A= + } else {=0A= + EX(caller_scope) =3D ce;=0A= + }=0A= +=0A= if (EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) {=0A= EX(object) =3D NULL;=0A= } else {=0A= @@ -2614,6 +2630,7 @@ static int ZEND_INIT_STATIC_METHOD_CALL_=0A= }=0A= if ((EX(object) =3D EG(This))) {=0A= EX(object)->refcount++;=0A= + EX(caller_scope) =3D Z_OBJCE_P(EX(object));=0A= }=0A= }=0A= =0A= @@ -3084,7 +3101,7 @@ static int ZEND_INIT_STATIC_METHOD_CALL_=0A= zval *function_name;=0A= zend_class_entry *ce;=0A= =0A= - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), NULL);=0A= + zend_ptr_stack_4_push(&EG(arg_types_stack), EX(fbc), EX(object), = EX(caller_scope), NULL);=0A= =0A= if (IS_CONST =3D=3D IS_CONST && IS_TMP_VAR =3D=3D IS_CONST) {=0A= /* try a function in namespace */=0A= @@ -3143,6 +3160,13 @@ static int ZEND_INIT_STATIC_METHOD_CALL_=0A= EX(fbc) =3D ce->constructor;=0A= }=0A= =0A= + if (EG(caller_scope) &&=0A= + instanceof_function(EG(caller_scope), ce TSRMLS_CC)) {=0A= + EX(caller_scope) =3D EG(caller_scope);=0A= + } else {=0A= + EX(caller_scope) =3D ce;=0A= + }=0A= +=0A= if (EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) {=0A= EX(object) =3D NULL;=0A= } else {=0A= @@ -3157,6 +3181,7 @@ static int ZEND_INIT_STATIC_METHOD_CALL_=0A= }=0A= if ((EX(object) =3D EG(This))) {=0A= EX(object)->refcount++;=0A= + EX(caller_scope) =3D Z_OBJCE_P(EX(object));=0A= }=0A= }=0A= =0A= @@ -3529,7 +3554,7 @@ static int ZEND_INIT_STATIC_METHOD_CALL_=0A= zval *function_name;=0A= zend_class_entry *ce;=0A= =0A= - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), NULL);=0A= + zend_ptr_stack_4_push(&EG(arg_types_stack), EX(fbc), EX(object), = EX(caller_scope), NULL);=0A= =0A= if (IS_CONST =3D=3D IS_CONST && IS_VAR =3D=3D IS_CONST) {=0A= /* try a function in namespace */=0A= @@ -3588,6 +3613,13 @@ static int ZEND_INIT_STATIC_METHOD_CALL_=0A= EX(fbc) =3D ce->constructor;=0A= }=0A= =0A= + if (EG(caller_scope) &&=0A= + instanceof_function(EG(caller_scope), ce TSRMLS_CC)) {=0A= + EX(caller_scope) =3D EG(caller_scope);=0A= + } else {=0A= + EX(caller_scope) =3D ce;=0A= + }=0A= +=0A= if (EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) {=0A= EX(object) =3D NULL;=0A= } else {=0A= @@ -3602,6 +3634,7 @@ static int ZEND_INIT_STATIC_METHOD_CALL_=0A= }=0A= if ((EX(object) =3D EG(This))) {=0A= EX(object)->refcount++;=0A= + EX(caller_scope) =3D Z_OBJCE_P(EX(object));=0A= }=0A= }=0A= =0A= @@ -3740,7 +3773,7 @@ static int ZEND_INIT_STATIC_METHOD_CALL_=0A= zval *function_name;=0A= zend_class_entry *ce;=0A= =0A= - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), NULL);=0A= + zend_ptr_stack_4_push(&EG(arg_types_stack), EX(fbc), EX(object), = EX(caller_scope), NULL);=0A= =0A= if (IS_CONST =3D=3D IS_CONST && IS_UNUSED =3D=3D IS_CONST) {=0A= /* try a function in namespace */=0A= @@ -3799,6 +3832,13 @@ static int ZEND_INIT_STATIC_METHOD_CALL_=0A= EX(fbc) =3D ce->constructor;=0A= }=0A= =0A= + if (EG(caller_scope) &&=0A= + instanceof_function(EG(caller_scope), ce TSRMLS_CC)) {=0A= + EX(caller_scope) =3D EG(caller_scope);=0A= + } else {=0A= + EX(caller_scope) =3D ce;=0A= + }=0A= +=0A= if (EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) {=0A= EX(object) =3D NULL;=0A= } else {=0A= @@ -3813,6 +3853,7 @@ static int ZEND_INIT_STATIC_METHOD_CALL_=0A= }=0A= if ((EX(object) =3D EG(This))) {=0A= EX(object)->refcount++;=0A= + EX(caller_scope) =3D Z_OBJCE_P(EX(object));=0A= }=0A= }=0A= =0A= @@ -4153,7 +4194,7 @@ static int ZEND_INIT_STATIC_METHOD_CALL_=0A= zval *function_name;=0A= zend_class_entry *ce;=0A= =0A= - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), NULL);=0A= + zend_ptr_stack_4_push(&EG(arg_types_stack), EX(fbc), EX(object), = EX(caller_scope), NULL);=0A= =0A= if (IS_CONST =3D=3D IS_CONST && IS_CV =3D=3D IS_CONST) {=0A= /* try a function in namespace */=0A= @@ -4212,6 +4253,13 @@ static int ZEND_INIT_STATIC_METHOD_CALL_=0A= EX(fbc) =3D ce->constructor;=0A= }=0A= =0A= + if (EG(caller_scope) &&=0A= + instanceof_function(EG(caller_scope), ce TSRMLS_CC)) {=0A= + EX(caller_scope) =3D EG(caller_scope);=0A= + } else {=0A= + EX(caller_scope) =3D ce;=0A= + }=0A= +=0A= if (EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) {=0A= EX(object) =3D NULL;=0A= } else {=0A= @@ -4226,6 +4274,7 @@ static int ZEND_INIT_STATIC_METHOD_CALL_=0A= }=0A= if ((EX(object) =3D EG(This))) {=0A= EX(object)->refcount++;=0A= + EX(caller_scope) =3D Z_OBJCE_P(EX(object));=0A= }=0A= }=0A= =0A= @@ -5750,7 +5799,7 @@ static int ZEND_INIT_METHOD_CALL_SPEC_TM=0A= /* FIXME: type is default */=0A= zend_uchar type =3D UG(unicode)?IS_UNICODE:IS_STRING;=0A= =0A= - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), NULL);=0A= + zend_ptr_stack_4_push(&EG(arg_types_stack), EX(fbc), EX(object), = EX(caller_scope), NULL);=0A= =0A= function_name =3D &opline->op2.u.constant;=0A= =0A= @@ -5777,6 +5826,8 @@ static int ZEND_INIT_METHOD_CALL_SPEC_TM=0A= zend_error_noreturn(E_ERROR, "Call to a member function %R() on a = non-object", Z_TYPE_P(function_name), function_name_strval);=0A= }=0A= =0A= + EX(caller_scope) =3D Z_OBJCE_P(EX(object));=0A= +=0A= if (EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) {=0A= EX(object) =3D NULL;=0A= } else {=0A= @@ -6199,7 +6250,7 @@ static int ZEND_INIT_METHOD_CALL_SPEC_TM=0A= /* FIXME: type is default */=0A= zend_uchar type =3D UG(unicode)?IS_UNICODE:IS_STRING;=0A= =0A= - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), NULL);=0A= + zend_ptr_stack_4_push(&EG(arg_types_stack), EX(fbc), EX(object), = EX(caller_scope), NULL);=0A= =0A= function_name =3D _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 = TSRMLS_CC);=0A= =0A= @@ -6226,6 +6277,8 @@ static int ZEND_INIT_METHOD_CALL_SPEC_TM=0A= zend_error_noreturn(E_ERROR, "Call to a member function %R() on a = non-object", Z_TYPE_P(function_name), function_name_strval);=0A= }=0A= =0A= + EX(caller_scope) =3D Z_OBJCE_P(EX(object));=0A= +=0A= if (EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) {=0A= EX(object) =3D NULL;=0A= } else {=0A= @@ -6650,7 +6703,7 @@ static int ZEND_INIT_METHOD_CALL_SPEC_TM=0A= /* FIXME: type is default */=0A= zend_uchar type =3D UG(unicode)?IS_UNICODE:IS_STRING;=0A= =0A= - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), NULL);=0A= + zend_ptr_stack_4_push(&EG(arg_types_stack), EX(fbc), EX(object), = EX(caller_scope), NULL);=0A= =0A= function_name =3D _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 = TSRMLS_CC);=0A= =0A= @@ -6677,6 +6730,8 @@ static int ZEND_INIT_METHOD_CALL_SPEC_TM=0A= zend_error_noreturn(E_ERROR, "Call to a member function %R() on a = non-object", Z_TYPE_P(function_name), function_name_strval);=0A= }=0A= =0A= + EX(caller_scope) =3D Z_OBJCE_P(EX(object));=0A= +=0A= if (EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) {=0A= EX(object) =3D NULL;=0A= } else {=0A= @@ -7194,7 +7249,7 @@ static int ZEND_INIT_METHOD_CALL_SPEC_TM=0A= /* FIXME: type is default */=0A= zend_uchar type =3D UG(unicode)?IS_UNICODE:IS_STRING;=0A= =0A= - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), NULL);=0A= + zend_ptr_stack_4_push(&EG(arg_types_stack), EX(fbc), EX(object), = EX(caller_scope), NULL);=0A= =0A= function_name =3D _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R = TSRMLS_CC);=0A= =0A= @@ -7221,6 +7276,8 @@ static int ZEND_INIT_METHOD_CALL_SPEC_TM=0A= zend_error_noreturn(E_ERROR, "Call to a member function %R() on a = non-object", Z_TYPE_P(function_name), function_name_strval);=0A= }=0A= =0A= + EX(caller_scope) =3D Z_OBJCE_P(EX(object));=0A= +=0A= if (EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) {=0A= EX(object) =3D NULL;=0A= } else {=0A= @@ -9946,7 +10003,7 @@ static int ZEND_INIT_METHOD_CALL_SPEC_VA=0A= /* FIXME: type is default */=0A= zend_uchar type =3D UG(unicode)?IS_UNICODE:IS_STRING;=0A= =0A= - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), NULL);=0A= + zend_ptr_stack_4_push(&EG(arg_types_stack), EX(fbc), EX(object), = EX(caller_scope), NULL);=0A= =0A= function_name =3D &opline->op2.u.constant;=0A= =0A= @@ -9973,6 +10030,8 @@ static int ZEND_INIT_METHOD_CALL_SPEC_VA=0A= zend_error_noreturn(E_ERROR, "Call to a member function %R() on a = non-object", Z_TYPE_P(function_name), function_name_strval);=0A= }=0A= =0A= + EX(caller_scope) =3D Z_OBJCE_P(EX(object));=0A= +=0A= if (EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) {=0A= EX(object) =3D NULL;=0A= } else {=0A= @@ -9998,7 +10057,7 @@ static int ZEND_INIT_STATIC_METHOD_CALL_=0A= zval *function_name;=0A= zend_class_entry *ce;=0A= =0A= - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), NULL);=0A= + zend_ptr_stack_4_push(&EG(arg_types_stack), EX(fbc), EX(object), = EX(caller_scope), NULL);=0A= =0A= if (IS_VAR =3D=3D IS_CONST && IS_CONST =3D=3D IS_CONST) {=0A= /* try a function in namespace */=0A= @@ -10057,6 +10116,13 @@ static int ZEND_INIT_STATIC_METHOD_CALL_=0A= EX(fbc) =3D ce->constructor;=0A= }=0A= =0A= + if (EG(caller_scope) &&=0A= + instanceof_function(EG(caller_scope), ce TSRMLS_CC)) {=0A= + EX(caller_scope) =3D EG(caller_scope);=0A= + } else {=0A= + EX(caller_scope) =3D ce;=0A= + }=0A= +=0A= if (EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) {=0A= EX(object) =3D NULL;=0A= } else {=0A= @@ -10071,6 +10137,7 @@ static int ZEND_INIT_STATIC_METHOD_CALL_=0A= }=0A= if ((EX(object) =3D EG(This))) {=0A= EX(object)->refcount++;=0A= + EX(caller_scope) =3D Z_OBJCE_P(EX(object));=0A= }=0A= }=0A= =0A= @@ -11635,7 +11702,7 @@ static int ZEND_INIT_METHOD_CALL_SPEC_VA=0A= /* FIXME: type is default */=0A= zend_uchar type =3D UG(unicode)?IS_UNICODE:IS_STRING;=0A= =0A= - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), NULL);=0A= + zend_ptr_stack_4_push(&EG(arg_types_stack), EX(fbc), EX(object), = EX(caller_scope), NULL);=0A= =0A= function_name =3D _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 = TSRMLS_CC);=0A= =0A= @@ -11662,6 +11729,8 @@ static int ZEND_INIT_METHOD_CALL_SPEC_VA=0A= zend_error_noreturn(E_ERROR, "Call to a member function %R() on a = non-object", Z_TYPE_P(function_name), function_name_strval);=0A= }=0A= =0A= + EX(caller_scope) =3D Z_OBJCE_P(EX(object));=0A= +=0A= if (EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) {=0A= EX(object) =3D NULL;=0A= } else {=0A= @@ -11688,7 +11757,7 @@ static int ZEND_INIT_STATIC_METHOD_CALL_=0A= zval *function_name;=0A= zend_class_entry *ce;=0A= =0A= - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), NULL);=0A= + zend_ptr_stack_4_push(&EG(arg_types_stack), EX(fbc), EX(object), = EX(caller_scope), NULL);=0A= =0A= if (IS_VAR =3D=3D IS_CONST && IS_TMP_VAR =3D=3D IS_CONST) {=0A= /* try a function in namespace */=0A= @@ -11747,6 +11816,13 @@ static int ZEND_INIT_STATIC_METHOD_CALL_=0A= EX(fbc) =3D ce->constructor;=0A= }=0A= =0A= + if (EG(caller_scope) &&=0A= + instanceof_function(EG(caller_scope), ce TSRMLS_CC)) {=0A= + EX(caller_scope) =3D EG(caller_scope);=0A= + } else {=0A= + EX(caller_scope) =3D ce;=0A= + }=0A= +=0A= if (EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) {=0A= EX(object) =3D NULL;=0A= } else {=0A= @@ -11761,6 +11837,7 @@ static int ZEND_INIT_STATIC_METHOD_CALL_=0A= }=0A= if ((EX(object) =3D EG(This))) {=0A= EX(object)->refcount++;=0A= + EX(caller_scope) =3D Z_OBJCE_P(EX(object));=0A= }=0A= }=0A= =0A= @@ -13303,7 +13380,7 @@ static int ZEND_INIT_METHOD_CALL_SPEC_VA=0A= /* FIXME: type is default */=0A= zend_uchar type =3D UG(unicode)?IS_UNICODE:IS_STRING;=0A= =0A= - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), NULL);=0A= + zend_ptr_stack_4_push(&EG(arg_types_stack), EX(fbc), EX(object), = EX(caller_scope), NULL);=0A= =0A= function_name =3D _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 = TSRMLS_CC);=0A= =0A= @@ -13330,6 +13407,8 @@ static int ZEND_INIT_METHOD_CALL_SPEC_VA=0A= zend_error_noreturn(E_ERROR, "Call to a member function %R() on a = non-object", Z_TYPE_P(function_name), function_name_strval);=0A= }=0A= =0A= + EX(caller_scope) =3D Z_OBJCE_P(EX(object));=0A= +=0A= if (EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) {=0A= EX(object) =3D NULL;=0A= } else {=0A= @@ -13356,7 +13435,7 @@ static int ZEND_INIT_STATIC_METHOD_CALL_=0A= zval *function_name;=0A= zend_class_entry *ce;=0A= =0A= - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), NULL);=0A= + zend_ptr_stack_4_push(&EG(arg_types_stack), EX(fbc), EX(object), = EX(caller_scope), NULL);=0A= =0A= if (IS_VAR =3D=3D IS_CONST && IS_VAR =3D=3D IS_CONST) {=0A= /* try a function in namespace */=0A= @@ -13415,6 +13494,13 @@ static int ZEND_INIT_STATIC_METHOD_CALL_=0A= EX(fbc) =3D ce->constructor;=0A= }=0A= =0A= + if (EG(caller_scope) &&=0A= + instanceof_function(EG(caller_scope), ce TSRMLS_CC)) {=0A= + EX(caller_scope) =3D EG(caller_scope);=0A= + } else {=0A= + EX(caller_scope) =3D ce;=0A= + }=0A= +=0A= if (EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) {=0A= EX(object) =3D NULL;=0A= } else {=0A= @@ -13429,6 +13515,7 @@ static int ZEND_INIT_STATIC_METHOD_CALL_=0A= }=0A= if ((EX(object) =3D EG(This))) {=0A= EX(object)->refcount++;=0A= + EX(caller_scope) =3D Z_OBJCE_P(EX(object));=0A= }=0A= }=0A= =0A= @@ -14222,7 +14309,7 @@ static int ZEND_INIT_STATIC_METHOD_CALL_=0A= zval *function_name;=0A= zend_class_entry *ce;=0A= =0A= - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), NULL);=0A= + zend_ptr_stack_4_push(&EG(arg_types_stack), EX(fbc), EX(object), = EX(caller_scope), NULL);=0A= =0A= if (IS_VAR =3D=3D IS_CONST && IS_UNUSED =3D=3D IS_CONST) {=0A= /* try a function in namespace */=0A= @@ -14281,6 +14368,13 @@ static int ZEND_INIT_STATIC_METHOD_CALL_=0A= EX(fbc) =3D ce->constructor;=0A= }=0A= =0A= + if (EG(caller_scope) &&=0A= + instanceof_function(EG(caller_scope), ce TSRMLS_CC)) {=0A= + EX(caller_scope) =3D EG(caller_scope);=0A= + } else {=0A= + EX(caller_scope) =3D ce;=0A= + }=0A= +=0A= if (EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) {=0A= EX(object) =3D NULL;=0A= } else {=0A= @@ -14295,6 +14389,7 @@ static int ZEND_INIT_STATIC_METHOD_CALL_=0A= }=0A= if ((EX(object) =3D EG(This))) {=0A= EX(object)->refcount++;=0A= + EX(caller_scope) =3D Z_OBJCE_P(EX(object));=0A= }=0A= }=0A= =0A= @@ -15488,7 +15583,7 @@ static int ZEND_INIT_METHOD_CALL_SPEC_VA=0A= /* FIXME: type is default */=0A= zend_uchar type =3D UG(unicode)?IS_UNICODE:IS_STRING;=0A= =0A= - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), NULL);=0A= + zend_ptr_stack_4_push(&EG(arg_types_stack), EX(fbc), EX(object), = EX(caller_scope), NULL);=0A= =0A= function_name =3D _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R = TSRMLS_CC);=0A= =0A= @@ -15515,6 +15610,8 @@ static int ZEND_INIT_METHOD_CALL_SPEC_VA=0A= zend_error_noreturn(E_ERROR, "Call to a member function %R() on a = non-object", Z_TYPE_P(function_name), function_name_strval);=0A= }=0A= =0A= + EX(caller_scope) =3D Z_OBJCE_P(EX(object));=0A= +=0A= if (EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) {=0A= EX(object) =3D NULL;=0A= } else {=0A= @@ -15540,7 +15637,7 @@ static int ZEND_INIT_STATIC_METHOD_CALL_=0A= zval *function_name;=0A= zend_class_entry *ce;=0A= =0A= - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), NULL);=0A= + zend_ptr_stack_4_push(&EG(arg_types_stack), EX(fbc), EX(object), = EX(caller_scope), NULL);=0A= =0A= if (IS_VAR =3D=3D IS_CONST && IS_CV =3D=3D IS_CONST) {=0A= /* try a function in namespace */=0A= @@ -15599,6 +15696,13 @@ static int ZEND_INIT_STATIC_METHOD_CALL_=0A= EX(fbc) =3D ce->constructor;=0A= }=0A= =0A= + if (EG(caller_scope) &&=0A= + instanceof_function(EG(caller_scope), ce TSRMLS_CC)) {=0A= + EX(caller_scope) =3D EG(caller_scope);=0A= + } else {=0A= + EX(caller_scope) =3D ce;=0A= + }=0A= +=0A= if (EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) {=0A= EX(object) =3D NULL;=0A= } else {=0A= @@ -15613,6 +15717,7 @@ static int ZEND_INIT_STATIC_METHOD_CALL_=0A= }=0A= if ((EX(object) =3D EG(This))) {=0A= EX(object)->refcount++;=0A= + EX(caller_scope) =3D Z_OBJCE_P(EX(object));=0A= }=0A= }=0A= =0A= @@ -16785,7 +16890,7 @@ static int ZEND_INIT_METHOD_CALL_SPEC_UN=0A= /* FIXME: type is default */=0A= zend_uchar type =3D UG(unicode)?IS_UNICODE:IS_STRING;=0A= =0A= - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), NULL);=0A= + zend_ptr_stack_4_push(&EG(arg_types_stack), EX(fbc), EX(object), = EX(caller_scope), NULL);=0A= =0A= function_name =3D &opline->op2.u.constant;=0A= =0A= @@ -16812,6 +16917,8 @@ static int ZEND_INIT_METHOD_CALL_SPEC_UN=0A= zend_error_noreturn(E_ERROR, "Call to a member function %R() on a = non-object", Z_TYPE_P(function_name), function_name_strval);=0A= }=0A= =0A= + EX(caller_scope) =3D Z_OBJCE_P(EX(object));=0A= +=0A= if (EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) {=0A= EX(object) =3D NULL;=0A= } else {=0A= @@ -17862,7 +17969,7 @@ static int ZEND_INIT_METHOD_CALL_SPEC_UN=0A= /* FIXME: type is default */=0A= zend_uchar type =3D UG(unicode)?IS_UNICODE:IS_STRING;=0A= =0A= - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), NULL);=0A= + zend_ptr_stack_4_push(&EG(arg_types_stack), EX(fbc), EX(object), = EX(caller_scope), NULL);=0A= =0A= function_name =3D _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 = TSRMLS_CC);=0A= =0A= @@ -17889,6 +17996,8 @@ static int ZEND_INIT_METHOD_CALL_SPEC_UN=0A= zend_error_noreturn(E_ERROR, "Call to a member function %R() on a = non-object", Z_TYPE_P(function_name), function_name_strval);=0A= }=0A= =0A= + EX(caller_scope) =3D Z_OBJCE_P(EX(object));=0A= +=0A= if (EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) {=0A= EX(object) =3D NULL;=0A= } else {=0A= @@ -18879,7 +18988,7 @@ static int ZEND_INIT_METHOD_CALL_SPEC_UN=0A= /* FIXME: type is default */=0A= zend_uchar type =3D UG(unicode)?IS_UNICODE:IS_STRING;=0A= =0A= - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), NULL);=0A= + zend_ptr_stack_4_push(&EG(arg_types_stack), EX(fbc), EX(object), = EX(caller_scope), NULL);=0A= =0A= function_name =3D _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 = TSRMLS_CC);=0A= =0A= @@ -18906,6 +19015,8 @@ static int ZEND_INIT_METHOD_CALL_SPEC_UN=0A= zend_error_noreturn(E_ERROR, "Call to a member function %R() on a = non-object", Z_TYPE_P(function_name), function_name_strval);=0A= }=0A= =0A= + EX(caller_scope) =3D Z_OBJCE_P(EX(object));=0A= +=0A= if (EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) {=0A= EX(object) =3D NULL;=0A= } else {=0A= @@ -20161,7 +20272,7 @@ static int ZEND_INIT_METHOD_CALL_SPEC_UN=0A= /* FIXME: type is default */=0A= zend_uchar type =3D UG(unicode)?IS_UNICODE:IS_STRING;=0A= =0A= - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), NULL);=0A= + zend_ptr_stack_4_push(&EG(arg_types_stack), EX(fbc), EX(object), = EX(caller_scope), NULL);=0A= =0A= function_name =3D _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R = TSRMLS_CC);=0A= =0A= @@ -20188,6 +20299,8 @@ static int ZEND_INIT_METHOD_CALL_SPEC_UN=0A= zend_error_noreturn(E_ERROR, "Call to a member function %R() on a = non-object", Z_TYPE_P(function_name), function_name_strval);=0A= }=0A= =0A= + EX(caller_scope) =3D Z_OBJCE_P(EX(object));=0A= +=0A= if (EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) {=0A= EX(object) =3D NULL;=0A= } else {=0A= @@ -22931,7 +23044,7 @@ static int ZEND_INIT_METHOD_CALL_SPEC_CV=0A= /* FIXME: type is default */=0A= zend_uchar type =3D UG(unicode)?IS_UNICODE:IS_STRING;=0A= =0A= - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), NULL);=0A= + zend_ptr_stack_4_push(&EG(arg_types_stack), EX(fbc), EX(object), = EX(caller_scope), NULL);=0A= =0A= function_name =3D &opline->op2.u.constant;=0A= =0A= @@ -22958,6 +23071,8 @@ static int ZEND_INIT_METHOD_CALL_SPEC_CV=0A= zend_error_noreturn(E_ERROR, "Call to a member function %R() on a = non-object", Z_TYPE_P(function_name), function_name_strval);=0A= }=0A= =0A= + EX(caller_scope) =3D Z_OBJCE_P(EX(object));=0A= +=0A= if (EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) {=0A= EX(object) =3D NULL;=0A= } else {=0A= @@ -24466,7 +24581,7 @@ static int ZEND_INIT_METHOD_CALL_SPEC_CV=0A= /* FIXME: type is default */=0A= zend_uchar type =3D UG(unicode)?IS_UNICODE:IS_STRING;=0A= =0A= - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), NULL);=0A= + zend_ptr_stack_4_push(&EG(arg_types_stack), EX(fbc), EX(object), = EX(caller_scope), NULL);=0A= =0A= function_name =3D _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 = TSRMLS_CC);=0A= =0A= @@ -24493,6 +24608,8 @@ static int ZEND_INIT_METHOD_CALL_SPEC_CV=0A= zend_error_noreturn(E_ERROR, "Call to a member function %R() on a = non-object", Z_TYPE_P(function_name), function_name_strval);=0A= }=0A= =0A= + EX(caller_scope) =3D Z_OBJCE_P(EX(object));=0A= +=0A= if (EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) {=0A= EX(object) =3D NULL;=0A= } else {=0A= @@ -26040,7 +26157,7 @@ static int ZEND_INIT_METHOD_CALL_SPEC_CV=0A= /* FIXME: type is default */=0A= zend_uchar type =3D UG(unicode)?IS_UNICODE:IS_STRING;=0A= =0A= - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), NULL);=0A= + zend_ptr_stack_4_push(&EG(arg_types_stack), EX(fbc), EX(object), = EX(caller_scope), NULL);=0A= =0A= function_name =3D _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 = TSRMLS_CC);=0A= =0A= @@ -26067,6 +26184,8 @@ static int ZEND_INIT_METHOD_CALL_SPEC_CV=0A= zend_error_noreturn(E_ERROR, "Call to a member function %R() on a = non-object", Z_TYPE_P(function_name), function_name_strval);=0A= }=0A= =0A= + EX(caller_scope) =3D Z_OBJCE_P(EX(object));=0A= +=0A= if (EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) {=0A= EX(object) =3D NULL;=0A= } else {=0A= @@ -28045,7 +28164,7 @@ static int ZEND_INIT_METHOD_CALL_SPEC_CV=0A= /* FIXME: type is default */=0A= zend_uchar type =3D UG(unicode)?IS_UNICODE:IS_STRING;=0A= =0A= - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), NULL);=0A= + zend_ptr_stack_4_push(&EG(arg_types_stack), EX(fbc), EX(object), = EX(caller_scope), NULL);=0A= =0A= function_name =3D _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R = TSRMLS_CC);=0A= =0A= @@ -28072,6 +28191,8 @@ static int ZEND_INIT_METHOD_CALL_SPEC_CV=0A= zend_error_noreturn(E_ERROR, "Call to a member function %R() on a = non-object", Z_TYPE_P(function_name), function_name_strval);=0A= }=0A= =0A= + EX(caller_scope) =3D Z_OBJCE_P(EX(object));=0A= +=0A= if (EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) {=0A= EX(object) =3D NULL;=0A= } else {=0A= Index: Zend/zend_vm_execute.skl=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= RCS file: /repository/ZendEngine2/zend_vm_execute.skl,v=0A= retrieving revision 1.7=0A= diff -u -p -d -r1.7 zend_vm_execute.skl=0A= --- Zend/zend_vm_execute.skl 21 Jul 2007 00:34:41 -0000 1.7=0A= +++ Zend/zend_vm_execute.skl 24 Aug 2007 16:50:17 -0000=0A= @@ -13,6 +13,7 @@ ZEND_API void {%EXECUTOR_NAME%}(zend_op_=0A= =0A= /* Initialize execute_data */=0A= EX(fbc) =3D NULL;=0A= + EX(caller_scope) =3D NULL;=0A= EX(object) =3D NULL;=0A= EX(old_error_reporting) =3D NULL;=0A= if (op_array->T < TEMP_VAR_STACK_LIMIT) {=0A= ------=_NextPart_000_0001_01C7E691.107D6C10--