@@ -6426,18 +6426,18 @@ static bool can_match_use_jumptable(zend_ast_list *arms) {
64266426 return 1 ;
64276427}
64286428
6429- static bool zend_is_deopt_pipe_name (zend_ast * ast )
6429+ static bool zend_is_pipe_optimizable_callable_name (zend_ast * ast )
64306430{
6431- if (ast -> kind != ZEND_AST_ZVAL || Z_TYPE_P (zend_ast_get_zval (ast )) != IS_STRING ) {
6432- return false;
6431+ if (ast -> kind == ZEND_AST_ZVAL && Z_TYPE_P (zend_ast_get_zval (ast )) == IS_STRING ) {
6432+ /* Assert compilation adds a message operand, but this is incompatible with the
6433+ * pipe optimization that uses a temporary znode for the reference elimination.
6434+ * Therefore, disable the optimization for assert.
6435+ * Note that "assert" as a name is always treated as fully qualified. */
6436+ zend_string * str = zend_ast_get_str (ast );
6437+ return !zend_string_equals_literal_ci (str , "assert" );
64336438 }
64346439
6435- /* Assert compilation adds a message operand, but this is incompatible with the
6436- * pipe optimization that uses a temporary znode for the reference elimination.
6437- * Therefore, disable the optimization for assert.
6438- * Note that "assert" as a name is always treated as fully qualified. */
6439- zend_string * str = zend_ast_get_str (ast );
6440- return zend_string_equals_literal_ci (str , "assert" );
6440+ return true;
64416441}
64426442
64436443static void zend_compile_pipe (znode * result , zend_ast * ast )
@@ -6468,7 +6468,7 @@ static void zend_compile_pipe(znode *result, zend_ast *ast)
64686468 /* Turn $foo |> bar(...) into bar($foo). */
64696469 if (callable_ast -> kind == ZEND_AST_CALL
64706470 && callable_ast -> child [1 ]-> kind == ZEND_AST_CALLABLE_CONVERT
6471- && ! zend_is_deopt_pipe_name (callable_ast -> child [0 ])) {
6471+ && zend_is_pipe_optimizable_callable_name (callable_ast -> child [0 ])) {
64726472 fcall_ast = zend_ast_create (ZEND_AST_CALL ,
64736473 callable_ast -> child [0 ], arg_list_ast );
64746474 /* Turn $foo |> bar::baz(...) into bar::baz($foo). */
0 commit comments