Skip to content

Commit 49963eb

Browse files
committed
Merge branch 'master' into assert
* master: Implemented AST pretty-printer update NEWS to match the actual stuff in 5.6.6 update NEWS to match the actual stuff in 5.5.22 update NEWS(add missing entry for the enchant fix, and reorder the entries a bit) fix typo in bug# update NEWS fix email format update NEWS update 5.6.6 release date in NEWS Fix bug #69033 (Request may get env. variables from previous requests if PHP works as FastCGI) BFN fix test fix test fix test Fixed bug #65593 (Segfault when calling ob_start from output buffering callback) Updated NEWS add CVE 5.4.39 next Fix associativity to match Perl Blast off to space. Conflicts: Zend/zend_ast.c
2 parents 07b1f92 + 6b77959 commit 49963eb

14 files changed

+3289
-2967
lines changed

Zend/zend_ast.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,7 @@ ZEND_API void zend_ast_apply(zend_ast *ast, zend_ast_apply_func fn) {
467467
* 150 left ^
468468
* 160 left &
469469
* 170 non-associative == != === !==
470-
* 180 non-associative < <= > >=
470+
* 180 non-associative < <= > >= <=>
471471
* 190 left << >>
472472
* 200 left + - .
473473
* 210 left * / %
@@ -1252,6 +1252,7 @@ static void zend_ast_export_ex(smart_str *str, zend_ast *ast, int priority, int
12521252
case ZEND_IS_SMALLER_OR_EQUAL: BINARY_OP(" <= ", 180, 181, 181);
12531253
case ZEND_POW: BINARY_OP(" ** ", 250, 251, 250);
12541254
case ZEND_BOOL_XOR: BINARY_OP(" xor ", 40, 40, 41);
1255+
case ZEND_SPACESHIP: BINARY_OP(" <=> ", 180, 181, 181);
12551256
EMPTY_SWITCH_DEFAULT_CASE();
12561257
}
12571258
break;

Zend/zend_language_parser.y

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ static YYSIZE_T zend_yytnamerr(char*, const char*);
7575
%left '|'
7676
%left '^'
7777
%left '&'
78-
%nonassoc T_IS_EQUAL T_IS_NOT_EQUAL T_IS_IDENTICAL T_IS_NOT_IDENTICAL
78+
%nonassoc T_IS_EQUAL T_IS_NOT_EQUAL T_IS_IDENTICAL T_IS_NOT_IDENTICAL T_SPACESHIP
7979
%nonassoc '<' T_IS_SMALLER_OR_EQUAL '>' T_IS_GREATER_OR_EQUAL
8080
%left T_SL T_SR
8181
%left '+' '-' '.'
@@ -131,6 +131,7 @@ static YYSIZE_T zend_yytnamerr(char*, const char*);
131131
%token T_IS_NOT_IDENTICAL "!== (T_IS_NOT_IDENTICAL)"
132132
%token T_IS_SMALLER_OR_EQUAL "<= (T_IS_SMALLER_OR_EQUAL)"
133133
%token T_IS_GREATER_OR_EQUAL ">= (T_IS_GREATER_OR_EQUAL)"
134+
%token T_SPACESHIP "<=> (T_SPACESHIP)"
134135
%token T_SL "<< (T_SL)"
135136
%token T_SR ">> (T_SR)"
136137
%token T_INSTANCEOF "instanceof (T_INSTANCEOF)"
@@ -846,6 +847,8 @@ expr_without_variable:
846847
{ $$ = zend_ast_create(ZEND_AST_GREATER, $1, $3); }
847848
| expr T_IS_GREATER_OR_EQUAL expr
848849
{ $$ = zend_ast_create(ZEND_AST_GREATER_EQUAL, $1, $3); }
850+
| expr T_SPACESHIP expr
851+
{ $$ = zend_ast_create_binary_op(ZEND_SPACESHIP, $1, $3); }
849852
| expr T_INSTANCEOF class_name_reference
850853
{ $$ = zend_ast_create(ZEND_AST_INSTANCEOF, $1, $3); }
851854
| '(' expr ')' { $$ = $2; }

0 commit comments

Comments
 (0)