Merge branch 'PHP-7.0'

This commit is contained in:
Nikita Popov 2016-03-30 18:32:29 +02:00
commit 29bc5a0b0f
2 changed files with 18 additions and 6 deletions

View File

@ -0,0 +1,16 @@
--TEST--
Closure::__invoke() is case insensitive
--FILE--
<?php
$inc = function(&$n) {
$n++;
};
$n = 1;
$inc->__INVOKE($n);
var_dump($n);
?>
--EXPECT--
int(2)

View File

@ -297,14 +297,10 @@ ZEND_API zval* zend_get_closure_this_ptr(zval *obj) /* {{{ */
static zend_function *zend_closure_get_method(zend_object **object, zend_string *method, const zval *key) /* {{{ */
{
zend_string *lc_name;
lc_name = zend_string_tolower(method);
if (zend_string_equals_literal(method, ZEND_INVOKE_FUNC_NAME)) {
zend_string_release(lc_name);
if (zend_string_equals_literal_ci(method, ZEND_INVOKE_FUNC_NAME)) {
return zend_get_closure_invoke_method(*object);
}
zend_string_release(lc_name);
return std_object_handlers.get_method(object, method, key);
}
/* }}} */