Skip to content

Commit 7b6365d

Browse files
committed
Optimize static method calls in pipes.
1 parent 2ba6512 commit 7b6365d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Zend/zend_compile.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6453,6 +6453,11 @@ static void zend_compile_pipe(znode *result, zend_ast *ast)
64536453
&& callable_ast->child[1]->kind == ZEND_AST_CALLABLE_CONVERT) {
64546454
fcall_ast = zend_ast_create(ZEND_AST_CALL,
64556455
callable_ast->child[0], arg_list_ast);
6456+
/* Turn $foo |> bar::>baz(...) into bar::baz($foo). */
6457+
} else if (callable_ast->kind == ZEND_AST_STATIC_CALL
6458+
&& callable_ast->child[2]->kind == ZEND_AST_CALLABLE_CONVERT) {
6459+
fcall_ast = zend_ast_create(ZEND_AST_STATIC_CALL,
6460+
callable_ast->child[0], callable_ast->child[1], arg_list_ast);
64566461
/* Turn $foo |> $bar->baz(...) into $bar->baz($foo). */
64576462
} else if (callable_ast->kind == ZEND_AST_METHOD_CALL
64586463
&& callable_ast->child[2]->kind == ZEND_AST_CALLABLE_CONVERT) {

0 commit comments

Comments
 (0)