summaryrefslogtreecommitdiff
path: root/Zend/zend_closures.c
diff options
context:
space:
mode:
authorNikita Popov <nikic@php.net>2016-07-05 15:51:11 +0200
committerNikita Popov <nikic@php.net>2016-07-05 15:52:03 +0200
commitdbe6a231942ff4cbd2f6373828cecf4744356886 (patch)
tree0bef973f1bd02b08266ac86d93dfaa5365c0b5b5 /Zend/zend_closures.c
parentceae9fb54013d1fac0bf7987398501915b054209 (diff)
downloadphp-git-dbe6a231942ff4cbd2f6373828cecf4744356886.tar.gz
Closure::fromCallable(): Getting non-static method statically
As this is new functionality, I'm going directly for a TypeError, rather than a deprecation warning.
Diffstat (limited to 'Zend/zend_closures.c')
-rw-r--r--Zend/zend_closures.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Zend/zend_closures.c b/Zend/zend_closures.c
index 137e437fb9..bedf022a4b 100644
--- a/Zend/zend_closures.c
+++ b/Zend/zend_closures.c
@@ -322,7 +322,7 @@ ZEND_METHOD(Closure, fromCallable)
success = zend_create_closure_from_callable(return_value, callable, &error);
EG(current_execute_data) = execute_data;
- if (success == FAILURE) {
+ if (success == FAILURE || error) {
if (error) {
zend_throw_exception_ex(zend_ce_type_error, 0, "Failed to create closure from callable: %s", error);
efree(error);