]> granicus.if.org Git - php/commitdiff
Restored original EG(scope) behavior when call object methods
authorDmitry Stogov <dmitry@zend.com>
Mon, 5 May 2014 22:04:05 +0000 (02:04 +0400)
committerDmitry Stogov <dmitry@zend.com>
Mon, 5 May 2014 22:04:05 +0000 (02:04 +0400)
Zend/zend_vm_def.h
Zend/zend_vm_execute.h

index 2538e86cd83d5cb6abe3226484c5fdc88b0fedd1..c0d88eaa666a083eff629ad241d158f6c36d5360 100644 (file)
@@ -1938,8 +1938,13 @@ ZEND_VM_HELPER(zend_do_fcall_common_helper, ANY, ANY)
                if (fbc->common.scope) {
                        should_change_scope = 1;
                        Z_OBJ(EG(This)) = object;
-//???                  EG(scope) = (object) ? NULL : fbc->common.scope;
+                       /* TODO: we don't set scope if we call an object method ??? */
+                       /* See: ext/pdo_sqlite/tests/pdo_fetch_func_001.phpt */
+#if 1
+                       EG(scope) = (object) ? NULL : fbc->common.scope;
+#else 
                        EG(scope) = fbc->common.scope;
+#endif
                        EG(called_scope) = EX(call)->called_scope;
                }
 
index 6abc07d4e5dafa287b27b965fb482b2eac12f615..da7c59a56e21a5bba5866733b08b3242b0779646 100644 (file)
@@ -548,8 +548,13 @@ static int ZEND_FASTCALL zend_do_fcall_common_helper_SPEC(ZEND_OPCODE_HANDLER_AR
                if (fbc->common.scope) {
                        should_change_scope = 1;
                        Z_OBJ(EG(This)) = object;
-//???                  EG(scope) = (object) ? NULL : fbc->common.scope;
+                       /* TODO: we don't set scope if we call an object method ??? */
+                       /* See: ext/pdo_sqlite/tests/pdo_fetch_func_001.phpt */
+#if 1
+                       EG(scope) = (object) ? NULL : fbc->common.scope;
+#else
                        EG(scope) = fbc->common.scope;
+#endif
                        EG(called_scope) = EX(call)->called_scope;
                }