diff options
author | Dmitry Stogov <dmitry@zend.com> | 2018-10-01 11:19:36 +0300 |
---|---|---|
committer | Dmitry Stogov <dmitry@zend.com> | 2018-10-01 11:19:36 +0300 |
commit | 2d87b51ae9dafc4000830bdebd49d7665d0a4f6f (patch) | |
tree | 2610a5e2641e17ba8bdbcebc618a73c6dfcb8e13 /Zend/zend_closures.c | |
parent | 9d47cb4593972859d7bb8747f1f0b8ae56d7712e (diff) | |
parent | 4fc5833b3ebda3078911808d296e62d5baa9bf52 (diff) | |
download | php-git-2d87b51ae9dafc4000830bdebd49d7665d0a4f6f.tar.gz |
Merge branch 'master' of git.php.net:php-src
* 'master' of git.php.net:php-src: (29 commits)
Fix the deplister rule to not ignore the .c file (Anatol)
Update .gitignore to include the Windows deplister program (win32/build/deplister.c)
Bug > Feature Request
NEWS and UPGRADING
Fixed bug #75479
Fix test
Fix some tests and improve coverage for Windows in SPL
Use already set variable
Fix reflection arguments for sodium_memzero function
Deprecate unbinding of $this of non-static methods
Generalize compile_typename
Fixed bug #76737
Fixed bug #72635
Remove and refactor ext/spl/examples
Remove outdated soap examples
Remove unused ext/bz2/php_bz2.def
Remove redundant ce from reflection property_reference
Only store zend_type inside reflection type_reference
Fixed bug #76946
Bump versions for 7.1.24-dev
...
Diffstat (limited to 'Zend/zend_closures.c')
-rw-r--r-- | Zend/zend_closures.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/Zend/zend_closures.c b/Zend/zend_closures.c index 56808e2496..6ee2325509 100644 --- a/Zend/zend_closures.c +++ b/Zend/zend_closures.c @@ -82,10 +82,14 @@ static zend_bool zend_valid_closure_binding( ZSTR_VAL(Z_OBJCE_P(newthis)->name)); return 0; } - } else if (!(func->common.fn_flags & ZEND_ACC_STATIC) && func->common.scope - && func->type == ZEND_INTERNAL_FUNCTION) { - zend_error(E_WARNING, "Cannot unbind $this of internal method"); - return 0; + } else if (is_fake_closure && func->common.scope + && !(func->common.fn_flags & ZEND_ACC_STATIC)) { + if (func->type == ZEND_INTERNAL_FUNCTION) { + zend_error(E_WARNING, "Cannot unbind $this of internal method"); + return 0; + } else { + zend_error(E_DEPRECATED, "Unbinding $this of a method is deprecated"); + } } if (scope && scope != func->common.scope && scope->type == ZEND_INTERNAL_CLASS) { |