mirror of
https://github.com/php/php-src.git
synced 2024-12-17 22:09:12 +08:00
Merge branch 'PHP-7.0'
This commit is contained in:
commit
29bc5a0b0f
16
Zend/tests/closure_invoke_case_insensitive.phpt
Normal file
16
Zend/tests/closure_invoke_case_insensitive.phpt
Normal 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)
|
@ -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);
|
||||
}
|
||||
/* }}} */
|
||||
|
Loading…
Reference in New Issue
Block a user