@@ -5037,19 +5037,24 @@ static zend_result zend_compile_func_array_map(znode *result, zend_ast_list *arg
50375037 zend_ast * callback = args -> child [0 ];
50385038
50395039 /* Bail out if the callback is not a FCC/PFA. */
5040- if (callback -> kind != ZEND_AST_CALL ) {
5041- return FAILURE ;
5042- }
5040+ zend_ast * args_ast ;
5041+ switch (callback -> kind ) {
5042+ case ZEND_AST_CALL :
5043+ case ZEND_AST_STATIC_CALL :
5044+ args_ast = zend_ast_call_get_args (callback );
5045+ if (args_ast -> kind != ZEND_AST_CALLABLE_CONVERT ) {
5046+ return FAILURE ;
5047+ }
50435048
5044- zend_ast * args_ast = zend_ast_call_get_args ( callback ) ;
5045- if ( args_ast -> kind != ZEND_AST_CALLABLE_CONVERT ) {
5046- return FAILURE ;
5049+ break ;
5050+ default :
5051+ return FAILURE ;
50475052 }
50485053
50495054 /* Bail out if the callback is assert() due to the AST stringification logic
50505055 * breaking for the generated call.
50515056 */
5052- if (zend_string_equals_literal_ci (zend_ast_get_str (callback -> child [0 ]), "assert" )) {
5057+ if (callback -> kind == ZEND_AST_CALL && zend_string_equals_literal_ci (zend_ast_get_str (callback -> child [0 ]), "assert" )) {
50535058 return FAILURE ;
50545059 }
50555060
@@ -5104,7 +5109,14 @@ static zend_result zend_compile_func_array_map(znode *result, zend_ast_list *arg
51045109
51055110 /* loop body */
51065111 znode call_result ;
5107- zend_compile_expr (& call_result , zend_ast_create (ZEND_AST_CALL , callback -> child [0 ], call_args ));
5112+ switch (callback -> kind ) {
5113+ case ZEND_AST_CALL :
5114+ zend_compile_expr (& call_result , zend_ast_create (ZEND_AST_CALL , callback -> child [0 ], call_args ));
5115+ break ;
5116+ case ZEND_AST_STATIC_CALL :
5117+ zend_compile_expr (& call_result , zend_ast_create (ZEND_AST_STATIC_CALL , callback -> child [0 ], callback -> child [1 ], call_args ));
5118+ break ;
5119+ }
51085120 opline = zend_emit_op (NULL , ZEND_ADD_ARRAY_ELEMENT , & call_result , & key );
51095121 SET_NODE (opline -> result , result );
51105122 /* end loop body */
0 commit comments