diff options
| author | Andrea Faulds <ajf@ajf.me> | 2014-08-18 14:47:57 +0100 |
|---|---|---|
| committer | Andrea Faulds <ajf@ajf.me> | 2014-08-18 14:47:57 +0100 |
| commit | 2f40631716aec538ce9c1c4ae0e71aed396aa2cd (patch) | |
| tree | fbbb15a23b36ae4a7f67ac77b5ac21bf2e685b15 | |
| parent | 333a465751aad417997a18ee3080c46d97986a91 (diff) | |
| download | php-git-2f40631716aec538ce9c1c4ae0e71aed396aa2cd.tar.gz | |
Fixed issues spotted by code review
| -rw-r--r-- | Zend/zend_closures.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Zend/zend_closures.c b/Zend/zend_closures.c index e76e0d1262..b613c69f1e 100644 --- a/Zend/zend_closures.c +++ b/Zend/zend_closures.c @@ -92,16 +92,16 @@ ZEND_METHOD(Closure, call) /* {{{ */ if (closure->func.type == ZEND_INTERNAL_FUNCTION) { /* verify that we aren't binding internal function to a wrong object */ - if((closure->func.common.fn_flags & ZEND_ACC_STATIC) == 0 && + if ((closure->func.common.fn_flags & ZEND_ACC_STATIC) == 0 && !instanceof_function(Z_OBJCE_P(newthis), closure->func.common.scope TSRMLS_CC)) { zend_error(E_WARNING, "Cannot bind function %s::%s to object of class %s", closure->func.common.scope->name->val, closure->func.common.function_name->val, Z_OBJCE_P(newthis)->name->val); RETURN_NULL(); } } + /* This should never happen as this closure must, by definition, be a callable */ if (zend_fcall_info_init(zclosure, 0, &fci, &fci_cache, NULL, NULL TSRMLS_CC) != SUCCESS) { - zend_error(E_ERROR, "Closure not callable"); - RETURN_NULL(); + ZEND_ASSERT(0); } fci.retval = &closure_result; |
