Skip to content

Commit ab8094c

Browse files
committed
Pack zend_constant.flags and zend_constant.module_number into reserved space inside zend_constant.value.
1 parent 7a41e4c commit ab8094c

15 files changed

+68
-60
lines changed

UPGRADING.INTERNALS

+6
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ PHP 7.3 INTERNALS UPGRADE NOTES
2525
v. php_add[c]slashes
2626
w. zend_class_entry.iterator_funcs
2727
x. Class declaration opcodes (DECLARE_INHERITED_CLASS ...)
28+
y. zend_constant
2829

2930
2. Build system changes
3031
a. Unix build system changes
@@ -160,6 +161,11 @@ PHP 7.3 INTERNALS UPGRADE NOTES
160161
- ADD_INTERFACE and ADD_TRAIT don't use run-time cache to keep interface or
161162
trait. These instructions are executed once, and caching is useless.
162163

164+
y. zend_constant.flags and zend_constant.module_number are packed into
165+
reserved space inside zend_constant.value. They should be accessed using
166+
ZEND_CONTANT_FLAGS(), ZEND_CONSTANTS_MODULE_NUMBER() and
167+
ZEND_CONTANT_SET_FLAGS() macros.
168+
163169
========================
164170
2. Build system changes
165171
========================

Zend/zend_builtin_functions.c

+5-5
Original file line numberDiff line numberDiff line change
@@ -909,9 +909,9 @@ ZEND_FUNCTION(define)
909909
"define(): Declaration of case-insensitive constants is deprecated");
910910
}
911911

912-
c.flags = case_sensitive; /* non persistent */
912+
/* non persistent */
913+
ZEND_CONSTANT_SET_FLAGS(&c, case_sensitive, PHP_USER_CONSTANT);
913914
c.name = zend_string_copy(name);
914-
c.module_number = PHP_USER_CONSTANT;
915915
if (zend_register_constant(&c) == SUCCESS) {
916916
RETURN_TRUE;
917917
} else {
@@ -2145,13 +2145,13 @@ ZEND_FUNCTION(get_defined_constants)
21452145
continue;
21462146
}
21472147

2148-
if (val->module_number == PHP_USER_CONSTANT) {
2148+
if (ZEND_CONSTANT_MODULE_NUMBER(val) == PHP_USER_CONSTANT) {
21492149
module_number = i;
2150-
} else if (val->module_number > i || val->module_number < 0) {
2150+
} else if (ZEND_CONSTANT_MODULE_NUMBER(val) > i) {
21512151
/* should not happen */
21522152
continue;
21532153
} else {
2154-
module_number = val->module_number;
2154+
module_number = ZEND_CONSTANT_MODULE_NUMBER(val);
21552155
}
21562156

21572157
if (Z_TYPE(modules[module_number]) == IS_UNDEF) {

Zend/zend_compile.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -1366,7 +1366,7 @@ ZEND_API int zend_unmangle_property_name_ex(const zend_string *name, const char
13661366
static zend_constant *zend_lookup_reserved_const(const char *name, size_t len) /* {{{ */
13671367
{
13681368
zend_constant *c = zend_hash_find_ptr_lc(EG(zend_constants), name, len);
1369-
if (c && !(c->flags & CONST_CS) && (c->flags & CONST_CT_SUBST)) {
1369+
if (c && !(ZEND_CONSTANT_FLAGS(c) & CONST_CS) && (ZEND_CONSTANT_FLAGS(c) & CONST_CT_SUBST)) {
13701370
return c;
13711371
}
13721372
return NULL;
@@ -1380,9 +1380,9 @@ static zend_bool zend_try_ct_eval_const(zval *zv, zend_string *name, zend_bool i
13801380
/* Substitute case-sensitive (or lowercase) constants */
13811381
c = zend_hash_find_ptr(EG(zend_constants), name);
13821382
if (c && (
1383-
((c->flags & CONST_PERSISTENT)
1383+
((ZEND_CONSTANT_FLAGS(c) & CONST_PERSISTENT)
13841384
&& !(CG(compiler_options) & ZEND_COMPILE_NO_PERSISTENT_CONSTANT_SUBSTITUTION)
1385-
&& (!(c->flags & CONST_NO_FILE_CACHE) || !(CG(compiler_options) & ZEND_COMPILE_WITH_FILE_CACHE)))
1385+
&& (!(ZEND_CONSTANT_FLAGS(c) & CONST_NO_FILE_CACHE) || !(CG(compiler_options) & ZEND_COMPILE_WITH_FILE_CACHE)))
13861386
|| (Z_TYPE(c->value) < IS_OBJECT && !(CG(compiler_options) & ZEND_COMPILE_NO_CONSTANT_SUBSTITUTION))
13871387
)) {
13881388
ZVAL_COPY_OR_DUP(zv, &c->value);

Zend/zend_constants.c

+17-22
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ void free_zend_constant(zval *zv)
3737
{
3838
zend_constant *c = Z_PTR_P(zv);
3939

40-
if (!(c->flags & CONST_PERSISTENT)) {
40+
if (!(ZEND_CONSTANT_FLAGS(c) & CONST_PERSISTENT)) {
4141
zval_ptr_dtor_nogc(&c->value);
4242
if (c->name) {
4343
zend_string_release_ex(c->name, 0);
@@ -82,7 +82,7 @@ static int clean_module_constant(zval *el, void *arg)
8282
zend_constant *c = (zend_constant *)Z_PTR_P(el);
8383
int module_number = *(int *)arg;
8484

85-
if (c->module_number == module_number) {
85+
if (ZEND_CONSTANT_MODULE_NUMBER(c) == module_number) {
8686
return 1;
8787
} else {
8888
return 0;
@@ -151,9 +151,8 @@ ZEND_API void zend_register_null_constant(const char *name, size_t name_len, int
151151
zend_constant c;
152152

153153
ZVAL_NULL(&c.value);
154-
c.flags = flags;
154+
ZEND_CONSTANT_SET_FLAGS(&c, flags, module_number);
155155
c.name = zend_string_init_interned(name, name_len, flags & CONST_PERSISTENT);
156-
c.module_number = module_number;
157156
zend_register_constant(&c);
158157
}
159158

@@ -162,9 +161,8 @@ ZEND_API void zend_register_bool_constant(const char *name, size_t name_len, zen
162161
zend_constant c;
163162

164163
ZVAL_BOOL(&c.value, bval);
165-
c.flags = flags;
164+
ZEND_CONSTANT_SET_FLAGS(&c, flags, module_number);
166165
c.name = zend_string_init_interned(name, name_len, flags & CONST_PERSISTENT);
167-
c.module_number = module_number;
168166
zend_register_constant(&c);
169167
}
170168

@@ -173,9 +171,8 @@ ZEND_API void zend_register_long_constant(const char *name, size_t name_len, zen
173171
zend_constant c;
174172

175173
ZVAL_LONG(&c.value, lval);
176-
c.flags = flags;
174+
ZEND_CONSTANT_SET_FLAGS(&c, flags, module_number);
177175
c.name = zend_string_init_interned(name, name_len, flags & CONST_PERSISTENT);
178-
c.module_number = module_number;
179176
zend_register_constant(&c);
180177
}
181178

@@ -185,9 +182,8 @@ ZEND_API void zend_register_double_constant(const char *name, size_t name_len, d
185182
zend_constant c;
186183

187184
ZVAL_DOUBLE(&c.value, dval);
188-
c.flags = flags;
185+
ZEND_CONSTANT_SET_FLAGS(&c, flags, module_number);
189186
c.name = zend_string_init_interned(name, name_len, flags & CONST_PERSISTENT);
190-
c.module_number = module_number;
191187
zend_register_constant(&c);
192188
}
193189

@@ -197,9 +193,8 @@ ZEND_API void zend_register_stringl_constant(const char *name, size_t name_len,
197193
zend_constant c;
198194

199195
ZVAL_STR(&c.value, zend_string_init_interned(strval, strlen, flags & CONST_PERSISTENT));
200-
c.flags = flags;
196+
ZEND_CONSTANT_SET_FLAGS(&c, flags, module_number);
201197
c.name = zend_string_init_interned(name, name_len, flags & CONST_PERSISTENT);
202-
c.module_number = module_number;
203198
zend_register_constant(&c);
204199
}
205200

@@ -257,7 +252,7 @@ static inline zend_constant *zend_get_constant_str_impl(const char *name, size_t
257252
char *lcname = do_alloca(name_len + 1, use_heap);
258253
zend_str_tolower_copy(lcname, name, name_len);
259254
if ((c = zend_hash_str_find_ptr(EG(zend_constants), lcname, name_len)) != NULL) {
260-
if (c->flags & CONST_CS) {
255+
if (ZEND_CONSTANT_FLAGS(c) & CONST_CS) {
261256
c = NULL;
262257
}
263258
} else {
@@ -288,7 +283,7 @@ static inline zend_constant *zend_get_constant_impl(zend_string *name)
288283
zv = zend_hash_str_find(EG(zend_constants), lcname, ZSTR_LEN(name));
289284
if (zv != NULL) {
290285
c = Z_PTR_P(zv);
291-
if (c->flags & CONST_CS) {
286+
if (ZEND_CONSTANT_FLAGS(c) & CONST_CS) {
292287
c = NULL;
293288
}
294289
} else {
@@ -436,7 +431,7 @@ ZEND_API zval *zend_get_constant_ex(zend_string *cname, zend_class_entry *scope,
436431
/* try lowercase */
437432
zend_str_tolower(lcname + prefix_len + 1, const_name_len);
438433
if ((c = zend_hash_str_find_ptr(EG(zend_constants), lcname, lcname_len)) != NULL) {
439-
if ((c->flags & CONST_CS) != 0) {
434+
if ((ZEND_CONSTANT_FLAGS(c) & CONST_CS) != 0) {
440435
c = NULL;
441436
}
442437
}
@@ -465,7 +460,7 @@ ZEND_API zval *zend_get_constant_ex(zend_string *cname, zend_class_entry *scope,
465460
}
466461

467462
if (!(flags & ZEND_GET_CONSTANT_NO_DEPRECATION_CHECK)) {
468-
if (!(c->flags & (CONST_CS|CONST_CT_SUBST)) && is_access_deprecated(c, name)) {
463+
if (!(ZEND_CONSTANT_FLAGS(c) & (CONST_CS|CONST_CT_SUBST)) && is_access_deprecated(c, name)) {
469464
zend_error(E_DEPRECATED,
470465
"Case-insensitive constants are deprecated. "
471466
"The correct casing for this constant is \"%s\"",
@@ -479,12 +474,12 @@ ZEND_API zval *zend_get_constant_ex(zend_string *cname, zend_class_entry *scope,
479474
static void* zend_hash_add_constant(HashTable *ht, zend_string *key, zend_constant *c)
480475
{
481476
void *ret;
482-
zend_constant *copy = pemalloc(sizeof(zend_constant), c->flags & CONST_PERSISTENT);
477+
zend_constant *copy = pemalloc(sizeof(zend_constant), ZEND_CONSTANT_FLAGS(c) & CONST_PERSISTENT);
483478

484479
memcpy(copy, c, sizeof(zend_constant));
485480
ret = zend_hash_add_ptr(ht, key, copy);
486481
if (!ret) {
487-
pefree(copy, c->flags & CONST_PERSISTENT);
482+
pefree(copy, ZEND_CONSTANT_FLAGS(c) & CONST_PERSISTENT);
488483
}
489484
return ret;
490485
}
@@ -499,14 +494,14 @@ ZEND_API int zend_register_constant(zend_constant *c)
499494
printf("Registering constant for module %d\n", c->module_number);
500495
#endif
501496

502-
if (!(c->flags & CONST_CS)) {
503-
lowercase_name = zend_string_tolower_ex(c->name, c->flags & CONST_PERSISTENT);
497+
if (!(ZEND_CONSTANT_FLAGS(c) & CONST_CS)) {
498+
lowercase_name = zend_string_tolower_ex(c->name, ZEND_CONSTANT_FLAGS(c) & CONST_PERSISTENT);
504499
lowercase_name = zend_new_interned_string(lowercase_name);
505500
name = lowercase_name;
506501
} else {
507502
char *slash = strrchr(ZSTR_VAL(c->name), '\\');
508503
if (slash) {
509-
lowercase_name = zend_string_init(ZSTR_VAL(c->name), ZSTR_LEN(c->name), c->flags & CONST_PERSISTENT);
504+
lowercase_name = zend_string_init(ZSTR_VAL(c->name), ZSTR_LEN(c->name), ZEND_CONSTANT_FLAGS(c) & CONST_PERSISTENT);
510505
zend_str_tolower(ZSTR_VAL(lowercase_name), slash - ZSTR_VAL(c->name));
511506
lowercase_name = zend_new_interned_string(lowercase_name);
512507
name = lowercase_name;
@@ -525,7 +520,7 @@ ZEND_API int zend_register_constant(zend_constant *c)
525520
}
526521
zend_error(E_NOTICE,"Constant %s already defined", ZSTR_VAL(name));
527522
zend_string_release(c->name);
528-
if (!(c->flags & CONST_PERSISTENT)) {
523+
if (!(ZEND_CONSTANT_FLAGS(c) & CONST_PERSISTENT)) {
529524
zval_ptr_dtor_nogc(&c->value);
530525
}
531526
ret = FAILURE;

Zend/zend_constants.h

+12-3
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,27 @@
2727
#define CONST_CT_SUBST (1<<2) /* Allow compile-time substitution */
2828
#define CONST_NO_FILE_CACHE (1<<3) /* Can't be saved in file cache */
2929

30-
#define PHP_USER_CONSTANT INT_MAX /* a constant defined in user space */
30+
#define PHP_USER_CONSTANT 0x7fffff /* a constant defined in user space */
3131

3232
/* Flag for zend_get_constant_ex(). Must not class with ZEND_FETCH_CLASS_* flags. */
3333
#define ZEND_GET_CONSTANT_NO_DEPRECATION_CHECK 0x1000
3434

3535
typedef struct _zend_constant {
3636
zval value;
3737
zend_string *name;
38-
int flags;
39-
int module_number;
4038
} zend_constant;
4139

40+
#define ZEND_CONSTANT_FLAGS(c) \
41+
(Z_CONSTANT_FLAGS((c)->value) & 0xff)
42+
43+
#define ZEND_CONSTANT_MODULE_NUMBER(c) \
44+
(Z_CONSTANT_FLAGS((c)->value) >> 8)
45+
46+
#define ZEND_CONSTANT_SET_FLAGS(c, _flags, _module_number) do { \
47+
Z_CONSTANT_FLAGS((c)->value) = \
48+
((_flags) & 0xff) | ((_module_number) << 8); \
49+
} while (0)
50+
4251
#define REGISTER_NULL_CONSTANT(name, flags) zend_register_null_constant((name), sizeof(name)-1, (flags), module_number)
4352
#define REGISTER_BOOL_CONSTANT(name, bval, flags) zend_register_bool_constant((name), sizeof(name)-1, (bval), (flags), module_number)
4453
#define REGISTER_LONG_CONSTANT(name, lval, flags) zend_register_long_constant((name), sizeof(name)-1, (lval), (flags), module_number)

Zend/zend_execute.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -3296,7 +3296,7 @@ static zend_always_inline int _zend_quick_get_constant(
32963296
} else {
32973297
key++;
32983298
zv = zend_hash_find_ex(EG(zend_constants), Z_STR_P(key), 1);
3299-
if (zv && (((zend_constant*)Z_PTR_P(zv))->flags & CONST_CS) == 0) {
3299+
if (zv && (ZEND_CONSTANT_FLAGS((zend_constant*)Z_PTR_P(zv)) & CONST_CS) == 0) {
33003300
c = (zend_constant*)Z_PTR_P(zv);
33013301
} else {
33023302
if ((flags & (IS_CONSTANT_IN_NAMESPACE|IS_CONSTANT_UNQUALIFIED)) == (IS_CONSTANT_IN_NAMESPACE|IS_CONSTANT_UNQUALIFIED)) {
@@ -3307,7 +3307,7 @@ static zend_always_inline int _zend_quick_get_constant(
33073307
} else {
33083308
key++;
33093309
zv = zend_hash_find_ex(EG(zend_constants), Z_STR_P(key), 1);
3310-
if (zv && (((zend_constant*)Z_PTR_P(zv))->flags & CONST_CS) == 0) {
3310+
if (zv && (ZEND_CONSTANT_FLAGS((zend_constant*)Z_PTR_P(zv)) & CONST_CS) == 0) {
33113311
c = (zend_constant*)Z_PTR_P(zv);
33123312
}
33133313
}
@@ -3339,7 +3339,7 @@ static zend_always_inline int _zend_quick_get_constant(
33393339

33403340
if (!check_defined_only) {
33413341
ZVAL_COPY_OR_DUP(EX_VAR(opline->result.var), &c->value);
3342-
if (!(c->flags & (CONST_CS|CONST_CT_SUBST))) {
3342+
if (!(ZEND_CONSTANT_FLAGS(c) & (CONST_CS|CONST_CT_SUBST))) {
33433343
const char *ns_sep;
33443344
size_t shortname_offset;
33453345
size_t shortname_len;

Zend/zend_execute_API.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ static void zend_extension_deactivator(zend_extension *extension) /* {{{ */
101101
static int clean_non_persistent_constant_full(zval *zv) /* {{{ */
102102
{
103103
zend_constant *c = Z_PTR_P(zv);
104-
return (c->flags & CONST_PERSISTENT) ? ZEND_HASH_APPLY_KEEP : ZEND_HASH_APPLY_REMOVE;
104+
return (ZEND_CONSTANT_FLAGS(c) & CONST_PERSISTENT) ? ZEND_HASH_APPLY_KEEP : ZEND_HASH_APPLY_REMOVE;
105105
}
106106
/* }}} */
107107

@@ -319,7 +319,7 @@ void shutdown_executor(void) /* {{{ */
319319
} else {
320320
ZEND_HASH_REVERSE_FOREACH_STR_KEY_VAL(EG(zend_constants), key, zv) {
321321
zend_constant *c = Z_PTR_P(zv);
322-
if (c->flags & CONST_PERSISTENT) {
322+
if (ZEND_CONSTANT_FLAGS(c) & CONST_PERSISTENT) {
323323
break;
324324
}
325325
zval_ptr_dtor_nogc(&c->value);

Zend/zend_types.h

+4
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,7 @@ struct _zval_struct {
203203
uint32_t fe_iter_idx; /* foreach iterator index */
204204
uint32_t access_flags; /* class constant access flags */
205205
uint32_t property_guard; /* single property guard */
206+
uint32_t constant_flags; /* constant flags */
206207
uint32_t extra; /* not further specified */
207208
} u2;
208209
};
@@ -449,6 +450,9 @@ static zend_always_inline zend_uchar zval_get_type(const zval* pz) {
449450
#define Z_PROPERTY_GUARD(zval) (zval).u2.property_guard
450451
#define Z_PROPERTY_GUARD_P(zval_p) Z_PROPERTY_GUARD(*(zval_p))
451452

453+
#define Z_CONSTANT_FLAGS(zval) (zval).u2.constant_flags
454+
#define Z_CONSTANT_FLAGS_P(zval_p) Z_CONSTANT_FLAGS(*(zval_p))
455+
452456
#define Z_EXTRA(zval) (zval).u2.extra
453457
#define Z_EXTRA_P(zval_p) Z_EXTRA(*(zval_p))
454458

Zend/zend_vm_def.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -7039,9 +7039,9 @@ ZEND_VM_HANDLER(143, ZEND_DECLARE_CONST, CONST, CONST)
70397039
HANDLE_EXCEPTION();
70407040
}
70417041
}
7042-
c.flags = CONST_CS; /* non persistent, case sensitive */
7042+
/* non persistent, case sensitive */
7043+
ZEND_CONSTANT_SET_FLAGS(&c, CONST_CS, PHP_USER_CONSTANT);
70437044
c.name = zend_string_copy(Z_STR_P(name));
7044-
c.module_number = PHP_USER_CONSTANT;
70457045

70467046
if (zend_register_constant(&c) == FAILURE) {
70477047
}

Zend/zend_vm_execute.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -5918,9 +5918,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_DECLARE_CONST_SPEC_CONST_CONST
59185918
HANDLE_EXCEPTION();
59195919
}
59205920
}
5921-
c.flags = CONST_CS; /* non persistent, case sensitive */
5921+
/* non persistent, case sensitive */
5922+
ZEND_CONSTANT_SET_FLAGS(&c, CONST_CS, PHP_USER_CONSTANT);
59225923
c.name = zend_string_copy(Z_STR_P(name));
5923-
c.module_number = PHP_USER_CONSTANT;
59245924

59255925
if (zend_register_constant(&c) == FAILURE) {
59265926
}

ext/opcache/Optimizer/block_pass.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ int zend_optimizer_get_persistent_constant(zend_string *name, zval *result, int
4444
zend_str_tolower(lookup_name, ZSTR_LEN(name));
4545

4646
if ((c = zend_hash_str_find_ptr(EG(zend_constants), lookup_name, ZSTR_LEN(name))) != NULL) {
47-
if (!(c->flags & CONST_CT_SUBST) || (c->flags & CONST_CS)) {
47+
if (!(ZEND_CONSTANT_FLAGS(c) & CONST_CT_SUBST) || (ZEND_CONSTANT_FLAGS(c) & CONST_CS)) {
4848
retval = 0;
4949
}
5050
} else {
@@ -54,8 +54,8 @@ int zend_optimizer_get_persistent_constant(zend_string *name, zval *result, int
5454
}
5555

5656
if (retval) {
57-
if ((c->flags & CONST_PERSISTENT)
58-
&& (!(c->flags & CONST_NO_FILE_CACHE)
57+
if ((ZEND_CONSTANT_FLAGS(c) & CONST_PERSISTENT)
58+
&& (!(ZEND_CONSTANT_FLAGS(c) & CONST_NO_FILE_CACHE)
5959
|| !(CG(compiler_options) & ZEND_COMPILE_WITH_FILE_CACHE))) {
6060
ZVAL_COPY_VALUE(result, &c->value);
6161
if (copy) {

ext/reflection/php_reflection.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -926,7 +926,7 @@ static int _extension_const_string(zval *el, int num_args, va_list args, zend_ha
926926
struct _zend_module_entry *module = va_arg(args, struct _zend_module_entry*);
927927
int *num_classes = va_arg(args, int*);
928928

929-
if (constant->module_number == module->module_number) {
929+
if (ZEND_CONSTANT_MODULE_NUMBER(constant) == module->module_number) {
930930
_const_string(str, ZSTR_VAL(constant->name), &constant->value, indent);
931931
(*num_classes)++;
932932
}
@@ -5696,7 +5696,7 @@ static int _addconstant(zval *el, int num_args, va_list args, zend_hash_key *has
56965696
zval *retval = va_arg(args, zval*);
56975697
int number = va_arg(args, int);
56985698

5699-
if (number == constant->module_number) {
5699+
if (number == ZEND_CONSTANT_MODULE_NUMBER(constant)) {
57005700
ZVAL_COPY_OR_DUP(&const_val, &constant->value);
57015701
zend_hash_update(Z_ARRVAL_P(retval), constant->name, &const_val);
57025702
}

sapi/cli/php_cli.c

+3-6
Original file line numberDiff line numberDiff line change
@@ -581,19 +581,16 @@ static void cli_register_file_handles(void) /* {{{ */
581581
php_stream_to_zval(s_out, &oc.value);
582582
php_stream_to_zval(s_err, &ec.value);
583583

584-
ic.flags = CONST_CS;
584+
ZEND_CONSTANT_SET_FLAGS(&ic, CONST_CS, 0);
585585
ic.name = zend_string_init_interned("STDIN", sizeof("STDIN")-1, 0);
586-
ic.module_number = 0;
587586
zend_register_constant(&ic);
588587

589-
oc.flags = CONST_CS;
588+
ZEND_CONSTANT_SET_FLAGS(&oc, CONST_CS, 0);
590589
oc.name = zend_string_init_interned("STDOUT", sizeof("STDOUT")-1, 0);
591-
oc.module_number = 0;
592590
zend_register_constant(&oc);
593591

594-
ec.flags = CONST_CS;
592+
ZEND_CONSTANT_SET_FLAGS(&ec, CONST_CS, 0);
595593
ec.name = zend_string_init_interned("STDERR", sizeof("STDERR")-1, 0);
596-
ec.module_number = 0;
597594
zend_register_constant(&ec);
598595
}
599596
/* }}} */

0 commit comments

Comments
 (0)