File tree Expand file tree Collapse file tree 3 files changed +16
-2
lines changed Expand file tree Collapse file tree 3 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -83,6 +83,7 @@ PHP NEWS
83
83
. Added SQLite3::setAuthorizer() and respective class constants. (bohwaz)
84
84
85
85
- Standard:
86
+ . Implemented FR #78638 (__PHP_Incomplete_Class should be final). (Laruence)
86
87
. Fixed bug #77204 (getimagesize(): Read error! should mention file path).
87
88
(peter279k)
88
89
. Fixed bug #76859 (stream_get_line skips data if used with data-generating
Original file line number Diff line number Diff line change @@ -108,9 +108,10 @@ static zend_object *php_create_incomplete_object(zend_class_entry *class_type)
108
108
109
109
PHPAPI zend_class_entry * php_create_incomplete_class (void )
110
110
{
111
- zend_class_entry incomplete_class ;
111
+ zend_class_entry incomplete_class , * incomplete_class_entry ;
112
112
113
113
INIT_CLASS_ENTRY (incomplete_class , INCOMPLETE_CLASS , NULL );
114
+
114
115
incomplete_class .create_object = php_create_incomplete_object ;
115
116
116
117
memcpy (& php_incomplete_object_handlers , & std_object_handlers , sizeof (zend_object_handlers ));
@@ -121,7 +122,10 @@ PHPAPI zend_class_entry *php_create_incomplete_class(void)
121
122
php_incomplete_object_handlers .get_property_ptr_ptr = incomplete_class_get_property_ptr_ptr ;
122
123
php_incomplete_object_handlers .get_method = incomplete_class_get_method ;
123
124
124
- return zend_register_internal_class (& incomplete_class );
125
+ incomplete_class_entry = zend_register_internal_class (& incomplete_class );
126
+ incomplete_class_entry -> ce_flags |= ZEND_ACC_FINAL ;
127
+
128
+ return incomplete_class_entry ;
125
129
}
126
130
/* }}} */
127
131
Original file line number Diff line number Diff line change
1
+ --TEST--
2
+ FR: #78638 (__PHP_Incomplete_Class should be final)
3
+ --FILE--
4
+ <?php
5
+ $ c = new class ('bar ' ) extends __PHP_Incomplete_Class {
6
+ };
7
+ ?>
8
+ --EXPECTF--
9
+ Fatal error: Class class@anonymous may not inherit from final class (__PHP_Incomplete_Class) in %sbug78638.php on line %d
You can’t perform that action at this time.
0 commit comments