Merge branch 'master' of git.php.net:/php-src

This commit is contained in:
Xinchen Hui 2015-11-27 07:31:53 -08:00
commit 229351cca2
2 changed files with 16 additions and 0 deletions

15
Zend/tests/bug70987.phpt Normal file
View File

@ -0,0 +1,15 @@
--TEST--
Bug #70987 (static::class within Closure::call() causes segfault)
--FILE--
<?php
class foo {}
$bar = function () {
return static::class;
};
var_dump($bar->call(new foo));
?>
--EXPECTF--
string(3) "foo"

View File

@ -150,6 +150,7 @@ ZEND_METHOD(Closure, call)
fci.param_count = my_param_count;
fci.object = fci_cache.object = newobj;
fci_cache.initialized = 1;
fci_cache.called_scope = Z_OBJCE_P(newthis);
if (fci_cache.function_handler->common.fn_flags & ZEND_ACC_GENERATOR) {
zval new_closure;