@@ -95,6 +95,26 @@ static zend_function *incomplete_class_get_method(zend_object **object, zend_str
9595}
9696/* }}} */
9797
98+ /* {{{ Private constructor preventing instantiation */
99+ static ZEND_COLD zend_function * incomplete_class_get_constructor (zend_object * object ) /* {{{ */
100+ {
101+ zend_throw_error (NULL , "Instantiation of class Closure is not allowed" );
102+ return NULL ;
103+ }
104+
105+ ZEND_COLD ZEND_METHOD (__PHP_Incomplete_Class , __construct )
106+ {
107+ zend_throw_error (NULL , "Instantiation of class __PHP_Incomplete_Class is not allowed" );
108+ }
109+ /* }}} */
110+
111+ /* {{{ Private clone preventing cloning */
112+ ZEND_COLD ZEND_METHOD (__PHP_Incomplete_Class , __clone )
113+ {
114+ zend_throw_error (NULL , "Cannot clone __PHP_Incomplete_Class using __clone()" );
115+ }
116+ /* }}} */
117+
98118/* {{{ php_create_incomplete_class */
99119static zend_object * php_create_incomplete_object (zend_class_entry * class_type )
100120{
@@ -124,26 +144,6 @@ PHPAPI void php_register_incomplete_class_handlers(void)
124144}
125145/* }}} */
126146
127- /* {{{ Private constructor preventing instantiation */
128- static ZEND_COLD zend_function * incomplete_class_get_constructor (zend_object * object ) /* {{{ */
129- {
130- zend_throw_error (NULL , "Instantiation of class Closure is not allowed" );
131- return NULL ;
132- }
133-
134- ZEND_COLD ZEND_METHOD (__PHP_Incomplete_Class , __construct )
135- {
136- zend_throw_error (NULL , "Instantiation of class __PHP_Incomplete_Class is not allowed" );
137- }
138- /* }}} */
139-
140- /* {{{ Private clone preventing cloning */
141- ZEND_COLD ZEND_METHOD (__PHP_Incomplete_Class , __clone )
142- {
143- zend_throw_error (NULL , "Cannot clone __PHP_Incomplete_Class using __clone()" );
144- }
145- /* }}} */
146-
147147/* {{{ php_lookup_class_name */
148148PHPAPI zend_string * php_lookup_class_name (zend_object * object )
149149{
0 commit comments