Merge branch 'PHP-5.6' into PHP-7.0

This commit is contained in:
Nikita Popov 2015-10-09 23:28:58 +02:00
commit d677b25b1c
2 changed files with 6 additions and 1 deletions

View file

@ -6,6 +6,11 @@ Bug #70681: Segfault when binding $this of internal instance method to null
$c = (new ReflectionMethod('SplStack', 'count'))->getClosure(new SplStack);
$c = $c->bindTo(null);
$c = (new ReflectionFunction('strlen'))->getClosure();
$c = $c->bindTo(null);
var_dump($c("foo"));
?>
--EXPECTF--
Warning: Cannot unbind $this of internal method in %s on line %d
int(3)

View file

@ -174,7 +174,7 @@ ZEND_METHOD(Closure, bind)
}
if (newthis == NULL && !(closure->func.common.fn_flags & ZEND_ACC_STATIC)
&& closure->func.type == ZEND_INTERNAL_FUNCTION) {
&& closure->func.common.scope && closure->func.type == ZEND_INTERNAL_FUNCTION) {
zend_error(E_WARNING, "Cannot unbind $this of internal method");
return;
}