File tree Expand file tree Collapse file tree 3 files changed +30
-1
lines changed Expand file tree Collapse file tree 3 files changed +30
-1
lines changed Original file line number Diff line number Diff line change @@ -51,6 +51,13 @@ class TraitAliasTest {
51
51
}
52
52
}
53
53
54
+ // Create reference to a property declared in an internal parent class.
55
+ class MyException extends Exception {
56
+ public function __construct ($ message ) {
57
+ $ this ->message =& $ message ;
58
+ }
59
+ }
60
+
54
61
function get_anon () {
55
62
return new class {};
56
63
}
Original file line number Diff line number Diff line change
1
+ --TEST--
2
+ Preloading of the property info table with internal parent
3
+ --INI--
4
+ opcache.enable=1
5
+ opcache.enable_cli=1
6
+ opcache.optimization_level=-1
7
+ opcache.preload={PWD}/preload.inc
8
+ --SKIPIF--
9
+ <?php
10
+ require_once ('skipif.inc ' );
11
+ if (PHP_OS_FAMILY == 'Windows ' ) die ('skip Preloading is not supported on Windows ' );
12
+ ?>
13
+ --FILE--
14
+ <?php
15
+ $ e = new MyException ("foo " );
16
+ echo $ e ->getMessage (), "\n" ;
17
+ ?>
18
+ --EXPECT--
19
+ foo
Original file line number Diff line number Diff line change @@ -914,8 +914,11 @@ static void zend_persist_class_entry(zval *zv)
914
914
915
915
for (i = 0 ; i < ce -> default_properties_count ; i ++ ) {
916
916
if (ce -> properties_info_table [i ]) {
917
- ce -> properties_info_table [ i ] = zend_shared_alloc_get_xlat_entry (
917
+ zend_property_info * prop_info = zend_shared_alloc_get_xlat_entry (
918
918
ce -> properties_info_table [i ]);
919
+ if (prop_info ) {
920
+ ce -> properties_info_table [i ] = prop_info ;
921
+ }
919
922
}
920
923
}
921
924
}
You can’t perform that action at this time.
0 commit comments