summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Zend/zend_execute_API.c1
-rw-r--r--ext/mysql/php_mysql.c1
-rw-r--r--ext/mysqli/mysqli.c1
-rwxr-xr-xext/pdo/pdo_dbh.c1
-rwxr-xr-xext/pdo/pdo_stmt.c2
-rw-r--r--ext/pgsql/pgsql.c1
-rw-r--r--ext/reflection/php_reflection.c7
-rwxr-xr-xext/spl/spl_directory.c1
-rw-r--r--ext/sqlite/sqlite.c1
-rw-r--r--main/streams/userspace.c1
10 files changed, 17 insertions, 0 deletions
diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c
index 0fb5851586..8a676dcea0 100644
--- a/Zend/zend_execute_API.c
+++ b/Zend/zend_execute_API.c
@@ -1254,6 +1254,7 @@ ZEND_API int zend_lookup_class_ex(const char *name, int name_length, int use_aut
fcall_cache.initialized = EG(autoload_func) ? 1 : 0;
fcall_cache.function_handler = EG(autoload_func);
fcall_cache.calling_scope = NULL;
+ fcall_cache.called_scope = NULL;
fcall_cache.object_pp = NULL;
exception = EG(exception);
diff --git a/ext/mysql/php_mysql.c b/ext/mysql/php_mysql.c
index 237bdb54e8..b395f6cdc6 100644
--- a/ext/mysql/php_mysql.c
+++ b/ext/mysql/php_mysql.c
@@ -2176,6 +2176,7 @@ static void php_mysql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int result_type,
fcc.initialized = 1;
fcc.function_handler = ce->constructor;
fcc.calling_scope = EG(scope);
+ fcc.called_scope = Z_OBJCE_P(return_value);
fcc.object_pp = &return_value;
if (zend_call_function(&fci, &fcc TSRMLS_CC) == FAILURE) {
diff --git a/ext/mysqli/mysqli.c b/ext/mysqli/mysqli.c
index 3056913d93..1cdab4dbd4 100644
--- a/ext/mysqli/mysqli.c
+++ b/ext/mysqli/mysqli.c
@@ -1305,6 +1305,7 @@ void php_mysqli_fetch_into_hash(INTERNAL_FUNCTION_PARAMETERS, int override_flags
fcc.initialized = 1;
fcc.function_handler = ce->constructor;
fcc.calling_scope = EG(scope);
+ fcc.called_scope = Z_OBJCE_P(return_value);
fcc.object_pp = &return_value;
if (zend_call_function(&fci, &fcc TSRMLS_CC) == FAILURE) {
diff --git a/ext/pdo/pdo_dbh.c b/ext/pdo/pdo_dbh.c
index 5ed7c98451..48327beb37 100755
--- a/ext/pdo/pdo_dbh.c
+++ b/ext/pdo/pdo_dbh.c
@@ -477,6 +477,7 @@ static void pdo_stmt_construct(pdo_stmt_t *stmt, zval *object, zend_class_entry
fcc.initialized = 1;
fcc.function_handler = dbstmt_ce->constructor;
fcc.calling_scope = EG(scope);
+ fcc.called_scope = Z_OBJCE_P(object);
fcc.object_pp = &object;
if (zend_call_function(&fci, &fcc TSRMLS_CC) == FAILURE) {
diff --git a/ext/pdo/pdo_stmt.c b/ext/pdo/pdo_stmt.c
index 5b676798f5..f4ae51c2c4 100755
--- a/ext/pdo/pdo_stmt.c
+++ b/ext/pdo/pdo_stmt.c
@@ -760,6 +760,7 @@ static int do_fetch_class_prepare(pdo_stmt_t *stmt TSRMLS_DC) /* {{{ */
fcc->initialized = 1;
fcc->function_handler = ce->constructor;
fcc->calling_scope = EG(scope);
+ fcc->called_scope = ce;
return 1;
} else if (stmt->fetch.cls.ctor_args) {
pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "user-supplied class does not have a constructor, use NULL for the ctor_params parameter, or simply omit it" TSRMLS_CC);
@@ -859,6 +860,7 @@ static int make_callable_ex(pdo_stmt_t *stmt, zval *callable, zend_fcall_info *
fcc->initialized = 1;
fcc->function_handler = function_handler;
fcc->calling_scope = EG(scope);
+ fcc->called_scope = Z_OBJCE_P(object);
fcc->object_pp = object;
return 1;
diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c
index 7f99939150..16dc1b0d76 100644
--- a/ext/pgsql/pgsql.c
+++ b/ext/pgsql/pgsql.c
@@ -2639,6 +2639,7 @@ static void php_pgsql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, long result_type,
fcc.initialized = 1;
fcc.function_handler = ce->constructor;
fcc.calling_scope = EG(scope);
+ fcc.called_scope = Z_OBJCE_P(return_value);
fcc.object_pp = &return_value;
if (zend_call_function(&fci, &fcc TSRMLS_CC) == FAILURE) {
diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c
index c746d7e5bc..4a30b921b8 100644
--- a/ext/reflection/php_reflection.c
+++ b/ext/reflection/php_reflection.c
@@ -1235,6 +1235,7 @@ static void _reflection_export(INTERNAL_FUNCTION_PARAMETERS, zend_class_entry *c
fcc.initialized = 1;
fcc.function_handler = ce_ptr->constructor;
fcc.calling_scope = ce_ptr;
+ fcc.called_scope = Z_OBJCE_P(reflection_ptr);
fcc.object_pp = &reflector_ptr;
result = zend_call_function(&fci, &fcc TSRMLS_CC);
@@ -1609,6 +1610,7 @@ ZEND_METHOD(reflection_function, invoke)
fcc.initialized = 1;
fcc.function_handler = fptr;
fcc.calling_scope = EG(scope);
+ fcc.called_scope = NULL;
fcc.object_pp = NULL;
result = zend_call_function(&fci, &fcc TSRMLS_CC);
@@ -1673,6 +1675,7 @@ ZEND_METHOD(reflection_function, invokeArgs)
fcc.initialized = 1;
fcc.function_handler = fptr;
fcc.calling_scope = EG(scope);
+ fcc.called_scope = NULL;
fcc.object_pp = NULL;
result = zend_call_function(&fci, &fcc TSRMLS_CC);
@@ -2413,6 +2416,7 @@ ZEND_METHOD(reflection_method, invoke)
fcc.initialized = 1;
fcc.function_handler = mptr;
fcc.calling_scope = obj_ce;
+ fcc.called_scope = Z_OBJCE_PP(object_pp);
fcc.object_pp = object_pp;
result = zend_call_function(&fci, &fcc TSRMLS_CC);
@@ -2519,6 +2523,7 @@ ZEND_METHOD(reflection_method, invokeArgs)
fcc.initialized = 1;
fcc.function_handler = mptr;
fcc.calling_scope = obj_ce;
+ fcc.called_scope = Z_OBJCE_P(object);
fcc.object_pp = &object;
result = zend_call_function(&fci, &fcc TSRMLS_CC);
@@ -3548,6 +3553,7 @@ ZEND_METHOD(reflection_class, newInstance)
fcc.initialized = 1;
fcc.function_handler = ce->constructor;
fcc.calling_scope = EG(scope);
+ fcc.called_scope = Z_OBJCE_P(return_value);
fcc.object_pp = &return_value;
if (zend_call_function(&fci, &fcc TSRMLS_CC) == FAILURE) {
@@ -3627,6 +3633,7 @@ ZEND_METHOD(reflection_class, newInstanceArgs)
fcc.initialized = 1;
fcc.function_handler = ce->constructor;
fcc.calling_scope = EG(scope);
+ fcc.called_scope = Z_OBJCE_P(return_value);
fcc.object_pp = &return_value;
if (zend_call_function(&fci, &fcc TSRMLS_CC) == FAILURE) {
diff --git a/ext/spl/spl_directory.c b/ext/spl/spl_directory.c
index 66f6ae5dc3..752a3e5451 100755
--- a/ext/spl/spl_directory.c
+++ b/ext/spl/spl_directory.c
@@ -1812,6 +1812,7 @@ static int spl_filesystem_file_call(spl_filesystem_object *intern, zend_function
fcic.initialized = 1;
fcic.function_handler = func_ptr;
fcic.calling_scope = NULL;
+ fcic.called_scope = NULL;
fcic.object_pp = NULL;
result = zend_call_function(&fci, &fcic TSRMLS_CC);
diff --git a/ext/sqlite/sqlite.c b/ext/sqlite/sqlite.c
index b643c23be9..b1d36fdba2 100644
--- a/ext/sqlite/sqlite.c
+++ b/ext/sqlite/sqlite.c
@@ -2507,6 +2507,7 @@ PHP_FUNCTION(sqlite_fetch_object)
fcc.initialized = 1;
fcc.function_handler = ce->constructor;
fcc.calling_scope = EG(scope);
+ fcc.called_scope = Z_OBJCE_P(return_value);
fcc.object_pp = &return_value;
if (zend_call_function(&fci, &fcc TSRMLS_CC) == FAILURE) {
diff --git a/main/streams/userspace.c b/main/streams/userspace.c
index 452c2aab0f..fbd03f1d56 100644
--- a/main/streams/userspace.c
+++ b/main/streams/userspace.c
@@ -262,6 +262,7 @@ static php_stream *user_wrapper_opener(php_stream_wrapper *wrapper, char *filena
fcc.initialized = 1;
fcc.function_handler = uwrap->ce->constructor;
fcc.calling_scope = EG(scope);
+ fcc.called_scope = Z_OBJCE_P(us->object);
fcc.object_pp = &us->object;
if (zend_call_function(&fci, &fcc TSRMLS_CC) == FAILURE) {