File tree 4 files changed +33
-0
lines changed
4 files changed +33
-0
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,8 @@ PHP NEWS
27
27
28
28
- Opcache:
29
29
. Fixed bug #78341 (Failure to detect smart branch in DFA pass). (Nikita)
30
+ . Fixed bug #78376 (Incorrect preloading of constant static properties).
31
+ (Dmitry)
30
32
31
33
- PCRE:
32
34
. Fixed bug #78338 (Array cross-border reading in PCRE). (cmb)
Original file line number Diff line number Diff line change @@ -4268,6 +4268,16 @@ static int accel_preload(const char *config)
4268
4268
ZEND_ASSERT (ce -> ce_flags & ZEND_ACC_PRELOADED );
4269
4269
if (ce -> default_static_members_count ) {
4270
4270
zend_cleanup_internal_class_data (ce );
4271
+ if (ce -> ce_flags & ZEND_ACC_CONSTANTS_UPDATED ) {
4272
+ int i ;
4273
+
4274
+ for (i = 0 ; i < ce -> default_static_members_count ; i ++ ) {
4275
+ if (Z_TYPE (ce -> default_static_members_table [i ]) == IS_CONSTANT_AST ) {
4276
+ ce -> ce_flags &= ~ZEND_ACC_CONSTANTS_UPDATED ;
4277
+ break ;
4278
+ }
4279
+ }
4280
+ }
4271
4281
}
4272
4282
if (ce -> ce_flags & ZEND_HAS_STATIC_IN_METHODS ) {
4273
4283
zend_op_array * op_array ;
Original file line number Diff line number Diff line change
1
+ --TEST--
2
+ Bug #78376 (Incorrect preloading of constant static properties)
3
+ --INI--
4
+ opcache.enable=1
5
+ opcache.enable_cli=1
6
+ opcache.optimization_level=-1
7
+ opcache.preload={PWD}/preload_bug78376.inc
8
+ --SKIPIF--
9
+ <?php require_once ('skipif.inc ' ); ?>
10
+ --FILE--
11
+ <?php
12
+ var_dump (\A::$ a );
13
+ ?>
14
+ --EXPECT--
15
+ string(4) "aaaa"
Original file line number Diff line number Diff line change
1
+ <?php
2
+ const CNST = 'aaaa ' ;
3
+ class A {
4
+ public static $ a = CNST ;
5
+ }
6
+ $ a = \A::$ a ;
You can’t perform that action at this time.
0 commit comments