Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Zend/zend_ast.c
Original file line number Diff line number Diff line change
Expand Up @@ -1252,6 +1252,7 @@ static void zend_ast_export_ex(smart_str *str, zend_ast *ast, int priority, int
case ZEND_POW: BINARY_OP(" ** ", 250, 251, 250);
case ZEND_BOOL_XOR: BINARY_OP(" xor ", 40, 40, 41);
case ZEND_SPACESHIP: BINARY_OP(" <=> ", 180, 181, 181);
case ZEND_IN: BINARY_OP(" in ", 235, 235, 236);
EMPTY_SWITCH_DEFAULT_CASE();
}
break;
Expand Down
7 changes: 5 additions & 2 deletions Zend/zend_language_parser.y
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ static YYSIZE_T zend_yytnamerr(char*, const char*);
%left '+' '-' '.'
%left '*' '/' '%'
%right '!'
%nonassoc T_INSTANCEOF
%nonassoc T_INSTANCEOF T_IN
%right '~' T_INC T_DEC T_INT_CAST T_DOUBLE_CAST T_STRING_CAST T_ARRAY_CAST T_OBJECT_CAST T_BOOL_CAST T_UNSET_CAST '@'
%right T_POW
%right '['
Expand Down Expand Up @@ -134,7 +134,8 @@ static YYSIZE_T zend_yytnamerr(char*, const char*);
%token T_SPACESHIP "<=> (T_SPACESHIP)"
%token T_SL "<< (T_SL)"
%token T_SR ">> (T_SR)"
%token T_INSTANCEOF "instanceof (T_INSTANCEOF)"
%token T_INSTANCEOF "instanceof (T_INSTANCEOF)"
%token T_IN "in (T_IN)"
%token T_INC "++ (T_INC)"
%token T_DEC "-- (T_DEC)"
%token T_INT_CAST "(int) (T_INT_CAST)"
Expand Down Expand Up @@ -849,6 +850,8 @@ expr_without_variable:
{ $$ = zend_ast_create(ZEND_AST_GREATER_EQUAL, $1, $3); }
| expr T_SPACESHIP expr
{ $$ = zend_ast_create_binary_op(ZEND_SPACESHIP, $1, $3); }
| expr T_IN expr
{ $$ = zend_ast_create_binary_op(ZEND_IN, $1, $3); }
| expr T_INSTANCEOF class_name_reference
{ $$ = zend_ast_create(ZEND_AST_INSTANCEOF, $1, $3); }
| '(' expr ')' { $$ = $2; }
Expand Down
Loading