@@ -2424,12 +2424,20 @@ static ZEND_COLD void zend_ast_export_ex(smart_str *str, zend_ast *ast, int prio
24242424 smart_str_appends (str , "::$" );
24252425 zend_ast_export_var (str , ast -> child [1 ], 0 , indent );
24262426 break ;
2427- case ZEND_AST_CALL :
2428- zend_ast_export_ns_name (str , ast -> child [0 ], 0 , indent );
2427+ case ZEND_AST_CALL : {
2428+ zend_ast * left = ast -> child [0 ];
2429+ if (left -> kind == ZEND_AST_ARROW_FUNC || left -> kind == ZEND_AST_CLOSURE ) {
2430+ smart_str_appends (str , "(" );
2431+ zend_ast_export_ns_name (str , left , 0 , indent );
2432+ smart_str_appends (str , ")" );
2433+ } else {
2434+ zend_ast_export_ns_name (str , left , 0 , indent );
2435+ }
24292436 smart_str_appendc (str , '(' );
24302437 zend_ast_export_ex (str , ast -> child [1 ], 0 , indent );
24312438 smart_str_appendc (str , ')' );
24322439 break ;
2440+ }
24332441 case ZEND_AST_PARENT_PROPERTY_HOOK_CALL :
24342442 smart_str_append (str , Z_STR_P (zend_ast_get_zval (ast -> child [0 ])));
24352443 smart_str_appendc (str , '(' );
0 commit comments