File tree Expand file tree Collapse file tree 2 files changed +25
-1
lines changed
tests/closure_const_expr/fcc Expand file tree Collapse file tree 2 files changed +25
-1
lines changed Original file line number Diff line number Diff line change 1+ --TEST--
2+ Allow defining FCC in const expressions with case-insensitive names.
3+ --FILE--
4+ <?php
5+
6+ const Closure = StrRev (...);
7+
8+ var_dump (Closure);
9+ var_dump ((Closure)("abc " ));
10+
11+ ?>
12+ --EXPECTF--
13+ object(Closure)#%d (2) {
14+ ["function"]=>
15+ string(%d) "%s"
16+ ["parameter"]=>
17+ array(1) {
18+ ["$string"]=>
19+ string(10) "<required>"
20+ }
21+ }
22+ string(3) "cba"
Original file line number Diff line number Diff line change @@ -1011,7 +1011,9 @@ ZEND_API zend_result ZEND_FASTCALL zend_ast_evaluate_inner(
10111011 ZEND_ASSERT (ast -> child [1 ]-> kind == ZEND_AST_CALLABLE_CONVERT );
10121012
10131013 zend_string * function_name = zend_ast_get_str (ast -> child [0 ]);
1014- fptr = zend_fetch_function (function_name );
1014+ zend_string * function_name_lc = zend_string_tolower (function_name );
1015+ fptr = zend_fetch_function (function_name_lc );
1016+ zend_string_release (function_name_lc );
10151017 if (!fptr ) {
10161018 zend_throw_error (NULL , "Call to undefined function %s()" , ZSTR_VAL (function_name ));
10171019 return FAILURE ;
You can’t perform that action at this time.
0 commit comments