diff options
Diffstat (limited to 'Zend/zend_execute_API.c')
-rw-r--r-- | Zend/zend_execute_API.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c index 52f0d9e3ef..84844992e0 100644 --- a/Zend/zend_execute_API.c +++ b/Zend/zend_execute_API.c @@ -716,6 +716,15 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache TS } } else { EG(This) = NULL; + if (calling_scope && !(EX(function_state).function->common.fn_flags & ZEND_ACC_STATIC)) { + int severity; + if (EX(function_state).function->common.fn_flags & (ZEND_ACC_CTOR|ZEND_ACC_DTOR|ZEND_ACC_CLONE)) { + severity = E_ERROR; + } else { + severity = E_STRICT; + } + zend_error(E_STRICT, "Cannot call non static method %s::%s() static", calling_scope->name, EX(function_state).function->common.function_name); + } } EX(prev_execute_data) = EG(current_execute_data); |