File tree 3 files changed +31
-0
lines changed
3 files changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -4322,6 +4322,16 @@ static int accel_preload(const char *config)
4322
4322
ZEND_ASSERT (ce -> ce_flags & ZEND_ACC_PRELOADED );
4323
4323
if (ce -> default_static_members_count ) {
4324
4324
zend_cleanup_internal_class_data (ce );
4325
+ if (ce -> ce_flags & ZEND_ACC_CONSTANTS_UPDATED ) {
4326
+ int i ;
4327
+
4328
+ for (i = 0 ; i < ce -> default_static_members_count ; i ++ ) {
4329
+ if (Z_TYPE (ce -> default_static_members_table [i ]) == IS_CONSTANT_AST ) {
4330
+ ce -> ce_flags &= ~ZEND_ACC_CONSTANTS_UPDATED ;
4331
+ break ;
4332
+ }
4333
+ }
4334
+ }
4325
4335
}
4326
4336
if (ce -> ce_flags & ZEND_HAS_STATIC_IN_METHODS ) {
4327
4337
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