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 @@ -999,7 +999,9 @@ ZEND_API zend_result ZEND_FASTCALL zend_ast_evaluate_inner(
999
999
ZEND_ASSERT (ast -> child [1 ]-> kind == ZEND_AST_CALLABLE_CONVERT );
1000
1000
1001
1001
zend_string * function_name = zend_ast_get_str (ast -> child [0 ]);
1002
- fptr = zend_fetch_function (function_name );
1002
+ zend_string * function_name_lc = zend_string_tolower (function_name );
1003
+ fptr = zend_fetch_function (function_name_lc );
1004
+ zend_string_release (function_name_lc );
1003
1005
if (!fptr ) {
1004
1006
zend_throw_error (NULL , "Call to undefined function %s()" , ZSTR_VAL (function_name ));
1005
1007
return FAILURE ;
You can’t perform that action at this time.
0 commit comments