Skip to content

Commit

Permalink
[Fix] Php5.3 token constants should be defined
Browse files Browse the repository at this point in the history
Summary:
We were updating 5.2 tokens to their 5.3 values, but not adding new ones (eg
T_GOTO, T_NAMESPACE etc).

Reviewed By: myang
Reviewers: je, andrewparoski, myang
CC: arice, michalburger1, myang, mwilliams
Differential Revision: 233690
  • Loading branch information
mwilliams authored and macvicar committed Apr 8, 2011
1 parent 5639ac0 commit f94f629
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 2 deletions.
2 changes: 1 addition & 1 deletion bin/gen_constants.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@

if (isset($constants[$name]) && $constants[$name] !== $value) {
error_log("PHP 5.3 change: $name: $constants[$name] => $value");
$constants[$name] = $value;
}
$constants[$name] = $value;
}

// sort by key
Expand Down
5 changes: 5 additions & 0 deletions src/system/gen/php/globals/constants.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1701,6 +1701,7 @@ const int64 k_T_CURLY_OPEN = 375LL;
const int64 k_T_DEC = 296LL;
const int64 k_T_DECLARE = 324LL;
const int64 k_T_DEFAULT = 330LL;
const int64 k_T_DIR = 379LL;
const int64 k_T_DIV_EQUAL = 274LL;
const int64 k_T_DNUMBER = 306LL;
const int64 k_T_DO = 317LL;
Expand Down Expand Up @@ -1733,6 +1734,7 @@ const int64 k_T_FOREACH = 322LL;
const int64 k_T_FUNCTION = 334LL;
const int64 k_T_FUNC_C = 363LL;
const int64 k_T_GLOBAL = 341LL;
const int64 k_T_GOTO = 333LL;
const int64 k_T_HALT_COMPILER = 352LL;
const int64 k_T_IF = 301LL;
const int64 k_T_IMPLEMENTS = 356LL;
Expand Down Expand Up @@ -1760,7 +1762,10 @@ const int64 k_T_METHOD_C = 362LL;
const int64 k_T_MINUS_EQUAL = 276LL;
const int64 k_T_MOD_EQUAL = 272LL;
const int64 k_T_MUL_EQUAL = 275LL;
const int64 k_T_NAMESPACE = 377LL;
const int64 k_T_NEW = 299LL;
const int64 k_T_NS_C = 378LL;
const int64 k_T_NS_SEPARATOR = 380LL;
const int64 k_T_NUM_STRING = 310LL;
const int64 k_T_OBJECT_CAST = 291LL;
const int64 k_T_OBJECT_OPERATOR = 357LL;
Expand Down
5 changes: 5 additions & 0 deletions src/system/gen/php/globals/constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -1704,6 +1704,7 @@ extern const int64 k_T_CURLY_OPEN;
extern const int64 k_T_DEC;
extern const int64 k_T_DECLARE;
extern const int64 k_T_DEFAULT;
extern const int64 k_T_DIR;
extern const int64 k_T_DIV_EQUAL;
extern const int64 k_T_DNUMBER;
extern const int64 k_T_DO;
Expand Down Expand Up @@ -1736,6 +1737,7 @@ extern const int64 k_T_FOREACH;
extern const int64 k_T_FUNCTION;
extern const int64 k_T_FUNC_C;
extern const int64 k_T_GLOBAL;
extern const int64 k_T_GOTO;
extern const int64 k_T_HALT_COMPILER;
extern const int64 k_T_IF;
extern const int64 k_T_IMPLEMENTS;
Expand Down Expand Up @@ -1763,7 +1765,10 @@ extern const int64 k_T_METHOD_C;
extern const int64 k_T_MINUS_EQUAL;
extern const int64 k_T_MOD_EQUAL;
extern const int64 k_T_MUL_EQUAL;
extern const int64 k_T_NAMESPACE;
extern const int64 k_T_NEW;
extern const int64 k_T_NS_C;
extern const int64 k_T_NS_SEPARATOR;
extern const int64 k_T_NUM_STRING;
extern const int64 k_T_OBJECT_CAST;
extern const int64 k_T_OBJECT_OPERATOR;
Expand Down
12 changes: 11 additions & 1 deletion src/system/gen/sys/dynamic_table_constant.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1702,6 +1702,7 @@ extern const int64 k_T_CURLY_OPEN;
extern const int64 k_T_DEC;
extern const int64 k_T_DECLARE;
extern const int64 k_T_DEFAULT;
extern const int64 k_T_DIR;
extern const int64 k_T_DIV_EQUAL;
extern const int64 k_T_DNUMBER;
extern const int64 k_T_DO;
Expand Down Expand Up @@ -1734,6 +1735,7 @@ extern const int64 k_T_FOREACH;
extern const int64 k_T_FUNCTION;
extern const int64 k_T_FUNC_C;
extern const int64 k_T_GLOBAL;
extern const int64 k_T_GOTO;
extern const int64 k_T_HALT_COMPILER;
extern const int64 k_T_IF;
extern const int64 k_T_IMPLEMENTS;
Expand Down Expand Up @@ -1761,7 +1763,10 @@ extern const int64 k_T_METHOD_C;
extern const int64 k_T_MINUS_EQUAL;
extern const int64 k_T_MOD_EQUAL;
extern const int64 k_T_MUL_EQUAL;
extern const int64 k_T_NAMESPACE;
extern const int64 k_T_NEW;
extern const int64 k_T_NS_C;
extern const int64 k_T_NS_SEPARATOR;
extern const int64 k_T_NUM_STRING;
extern const int64 k_T_OBJECT_CAST;
extern const int64 k_T_OBJECT_OPERATOR;
Expand Down Expand Up @@ -2082,7 +2087,7 @@ class hashNodeCon {
hashNodeCon *next;
};
static hashNodeCon *conMapTable[8192];
static hashNodeCon conBuckets[2085];
static hashNodeCon conBuckets[2090];

void init_builtin_constant_table() {
const char *conMapData[] = {
Expand Down Expand Up @@ -3816,6 +3821,7 @@ void init_builtin_constant_table() {
(const char *)"T_DEC", (const char *)-1, (const char *)32, (const char *)&k_T_DEC,
(const char *)"T_DECLARE", (const char *)-1, (const char *)32, (const char *)&k_T_DECLARE,
(const char *)"T_DEFAULT", (const char *)-1, (const char *)32, (const char *)&k_T_DEFAULT,
(const char *)"T_DIR", (const char *)-1, (const char *)32, (const char *)&k_T_DIR,
(const char *)"T_DIV_EQUAL", (const char *)-1, (const char *)32, (const char *)&k_T_DIV_EQUAL,
(const char *)"T_DNUMBER", (const char *)-1, (const char *)32, (const char *)&k_T_DNUMBER,
(const char *)"T_DO", (const char *)-1, (const char *)32, (const char *)&k_T_DO,
Expand Down Expand Up @@ -3848,6 +3854,7 @@ void init_builtin_constant_table() {
(const char *)"T_FUNCTION", (const char *)-1, (const char *)32, (const char *)&k_T_FUNCTION,
(const char *)"T_FUNC_C", (const char *)-1, (const char *)32, (const char *)&k_T_FUNC_C,
(const char *)"T_GLOBAL", (const char *)-1, (const char *)32, (const char *)&k_T_GLOBAL,
(const char *)"T_GOTO", (const char *)-1, (const char *)32, (const char *)&k_T_GOTO,
(const char *)"T_HALT_COMPILER", (const char *)-1, (const char *)32, (const char *)&k_T_HALT_COMPILER,
(const char *)"T_IF", (const char *)-1, (const char *)32, (const char *)&k_T_IF,
(const char *)"T_IMPLEMENTS", (const char *)-1, (const char *)32, (const char *)&k_T_IMPLEMENTS,
Expand Down Expand Up @@ -3875,7 +3882,10 @@ void init_builtin_constant_table() {
(const char *)"T_MINUS_EQUAL", (const char *)-1, (const char *)32, (const char *)&k_T_MINUS_EQUAL,
(const char *)"T_MOD_EQUAL", (const char *)-1, (const char *)32, (const char *)&k_T_MOD_EQUAL,
(const char *)"T_MUL_EQUAL", (const char *)-1, (const char *)32, (const char *)&k_T_MUL_EQUAL,
(const char *)"T_NAMESPACE", (const char *)-1, (const char *)32, (const char *)&k_T_NAMESPACE,
(const char *)"T_NEW", (const char *)-1, (const char *)32, (const char *)&k_T_NEW,
(const char *)"T_NS_C", (const char *)-1, (const char *)32, (const char *)&k_T_NS_C,
(const char *)"T_NS_SEPARATOR", (const char *)-1, (const char *)32, (const char *)&k_T_NS_SEPARATOR,
(const char *)"T_NUM_STRING", (const char *)-1, (const char *)32, (const char *)&k_T_NUM_STRING,
(const char *)"T_OBJECT_CAST", (const char *)-1, (const char *)32, (const char *)&k_T_OBJECT_CAST,
(const char *)"T_OBJECT_OPERATOR", (const char *)-1, (const char *)32, (const char *)&k_T_OBJECT_OPERATOR,
Expand Down
5 changes: 5 additions & 0 deletions src/system/globals/constants.php
Original file line number Diff line number Diff line change
Expand Up @@ -1682,6 +1682,7 @@
define('T_DEC', 296);
define('T_DECLARE', 324);
define('T_DEFAULT', 330);
define('T_DIR', 379);
define('T_DIV_EQUAL', 274);
define('T_DNUMBER', 306);
define('T_DO', 317);
Expand Down Expand Up @@ -1714,6 +1715,7 @@
define('T_FUNCTION', 334);
define('T_FUNC_C', 363);
define('T_GLOBAL', 341);
define('T_GOTO', 333);
define('T_HALT_COMPILER', 352);
define('T_IF', 301);
define('T_IMPLEMENTS', 356);
Expand Down Expand Up @@ -1741,7 +1743,10 @@
define('T_MINUS_EQUAL', 276);
define('T_MOD_EQUAL', 272);
define('T_MUL_EQUAL', 275);
define('T_NAMESPACE', 377);
define('T_NEW', 299);
define('T_NS_C', 378);
define('T_NS_SEPARATOR', 380);
define('T_NUM_STRING', 310);
define('T_OBJECT_CAST', 291);
define('T_OBJECT_OPERATOR', 357);
Expand Down

0 comments on commit f94f629

Please sign in to comment.