From 56c1d747feedf0b0f6cb3570f1d0f5c3b1d83306 Mon Sep 17 00:00:00 2001 From: Jordi Kroon Date: Sun, 1 Mar 2026 19:56:59 +0100 Subject: [PATCH 1/5] prevent instantiation and cloning of __PHP_Incomplete_Class --- ext/standard/basic_functions.stub.php | 2 ++ ext/standard/basic_functions_arginfo.h | 16 ++++++++++++-- ext/standard/basic_functions_decl.h | 8 +++---- ext/standard/incomplete_class.c | 22 +++++++++++++++++++ .../serialize/incomplete_class_clone.phpt | 19 ++++++++++++++++ .../incomplete_class_constructor.phpt | 14 ++++++++++++ ...e_class_newinstancewithoutconstructor.phpt | 12 ++++++++++ 7 files changed, 87 insertions(+), 6 deletions(-) create mode 100644 ext/standard/tests/serialize/incomplete_class_clone.phpt create mode 100644 ext/standard/tests/serialize/incomplete_class_constructor.phpt create mode 100644 ext/standard/tests/serialize/incomplete_class_newinstancewithoutconstructor.phpt diff --git a/ext/standard/basic_functions.stub.php b/ext/standard/basic_functions.stub.php index 6fa0d47c7bd7f..5b10f585fedaa 100644 --- a/ext/standard/basic_functions.stub.php +++ b/ext/standard/basic_functions.stub.php @@ -1487,6 +1487,8 @@ #[AllowDynamicProperties] final class __PHP_Incomplete_Class { + private function __construct() {} + private function __clone(): void {} } class AssertionError extends Error diff --git a/ext/standard/basic_functions_arginfo.h b/ext/standard/basic_functions_arginfo.h index e467710f72f91..174437f9f3b7f 100644 --- a/ext/standard/basic_functions_arginfo.h +++ b/ext/standard/basic_functions_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit basic_functions.stub.php instead. - * Stub hash: 8d1c2a735f412f8571675c6b025c3a418b68fb65 + * Stub hash: bf06c50808ee7aa18cf3a9135cb7d080a4622848 * Has decl header: yes */ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_set_time_limit, 0, 1, _IS_BOOL, 0) @@ -2191,6 +2191,10 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sapi_windows_generate_ctrl_event ZEND_END_ARG_INFO() #endif +#define arginfo_class___PHP_Incomplete_Class___construct arginfo_tmpfile + +#define arginfo_class___PHP_Incomplete_Class___clone arginfo_flush + ZEND_FRAMELESS_FUNCTION(min, 2); static const zend_frameless_function_info frameless_function_infos_min[] = { @@ -2893,6 +2897,8 @@ ZEND_FUNCTION(sapi_windows_cp_is_utf8); ZEND_FUNCTION(sapi_windows_set_ctrl_handler); ZEND_FUNCTION(sapi_windows_generate_ctrl_event); #endif +ZEND_METHOD(__PHP_Incomplete_Class, __construct); +ZEND_METHOD(__PHP_Incomplete_Class, __clone); static const zend_function_entry ext_functions[] = { ZEND_FE(set_time_limit, arginfo_set_time_limit) @@ -3509,6 +3515,12 @@ static const zend_function_entry ext_functions[] = { ZEND_FE_END }; +static const zend_function_entry class___PHP_Incomplete_Class_methods[] = { + ZEND_ME(__PHP_Incomplete_Class, __construct, arginfo_class___PHP_Incomplete_Class___construct, ZEND_ACC_PRIVATE) + ZEND_ME(__PHP_Incomplete_Class, __clone, arginfo_class___PHP_Incomplete_Class___clone, ZEND_ACC_PRIVATE) + ZEND_FE_END +}; + static void register_basic_functions_symbols(int module_number) { REGISTER_LONG_CONSTANT("EXTR_OVERWRITE", PHP_EXTR_OVERWRITE, CONST_PERSISTENT); @@ -3984,7 +3996,7 @@ static zend_class_entry *register_class___PHP_Incomplete_Class(void) { zend_class_entry ce, *class_entry; - INIT_CLASS_ENTRY(ce, "__PHP_Incomplete_Class", NULL); + INIT_CLASS_ENTRY(ce, "__PHP_Incomplete_Class", class___PHP_Incomplete_Class_methods); class_entry = zend_register_internal_class_with_flags(&ce, NULL, ZEND_ACC_FINAL|ZEND_ACC_ALLOW_DYNAMIC_PROPERTIES); zend_string *attribute_name_AllowDynamicProperties_class___PHP_Incomplete_Class_0 = zend_string_init_interned("AllowDynamicProperties", sizeof("AllowDynamicProperties") - 1, true); diff --git a/ext/standard/basic_functions_decl.h b/ext/standard/basic_functions_decl.h index 9e6fb0def4472..a8fa76ccbc338 100644 --- a/ext/standard/basic_functions_decl.h +++ b/ext/standard/basic_functions_decl.h @@ -1,8 +1,8 @@ /* This is a generated file, edit basic_functions.stub.php instead. - * Stub hash: 8d1c2a735f412f8571675c6b025c3a418b68fb65 */ + * Stub hash: bf06c50808ee7aa18cf3a9135cb7d080a4622848 */ -#ifndef ZEND_BASIC_FUNCTIONS_DECL_8d1c2a735f412f8571675c6b025c3a418b68fb65_H -#define ZEND_BASIC_FUNCTIONS_DECL_8d1c2a735f412f8571675c6b025c3a418b68fb65_H +#ifndef ZEND_BASIC_FUNCTIONS_DECL_bf06c50808ee7aa18cf3a9135cb7d080a4622848_H +#define ZEND_BASIC_FUNCTIONS_DECL_bf06c50808ee7aa18cf3a9135cb7d080a4622848_H typedef enum zend_enum_RoundingMode { ZEND_ENUM_RoundingMode_HalfAwayFromZero = 1, @@ -15,4 +15,4 @@ typedef enum zend_enum_RoundingMode { ZEND_ENUM_RoundingMode_PositiveInfinity = 8, } zend_enum_RoundingMode; -#endif /* ZEND_BASIC_FUNCTIONS_DECL_8d1c2a735f412f8571675c6b025c3a418b68fb65_H */ +#endif /* ZEND_BASIC_FUNCTIONS_DECL_bf06c50808ee7aa18cf3a9135cb7d080a4622848_H */ diff --git a/ext/standard/incomplete_class.c b/ext/standard/incomplete_class.c index 228e03fbe863e..149d3026a65eb 100644 --- a/ext/standard/incomplete_class.c +++ b/ext/standard/incomplete_class.c @@ -111,6 +111,8 @@ static zend_object *php_create_incomplete_object(zend_class_entry *class_type) PHPAPI void php_register_incomplete_class_handlers(void) { memcpy(&php_incomplete_object_handlers, &std_object_handlers, sizeof(zend_object_handlers)); + + php_incomplete_object_handlers.get_constructor = incomplete_class_get_constructor; php_incomplete_object_handlers.read_property = incomplete_class_get_property; php_incomplete_object_handlers.has_property = incomplete_class_has_property; php_incomplete_object_handlers.unset_property = incomplete_class_unset_property; @@ -122,6 +124,26 @@ PHPAPI void php_register_incomplete_class_handlers(void) } /* }}} */ +/* {{{ Private constructor preventing instantiation */ +static ZEND_COLD zend_function *incomplete_class_get_constructor(zend_object *object) /* {{{ */ +{ + zend_throw_error(NULL, "Instantiation of class Closure is not allowed"); + return NULL; +} + +ZEND_COLD ZEND_METHOD(__PHP_Incomplete_Class, __construct) +{ + zend_throw_error(NULL, "Instantiation of class __PHP_Incomplete_Class is not allowed"); +} +/* }}} */ + +/* {{{ Private clone preventing cloning */ +ZEND_COLD ZEND_METHOD(__PHP_Incomplete_Class, __clone) +{ + zend_throw_error(NULL, "Cannot clone __PHP_Incomplete_Class using __clone()"); +} +/* }}} */ + /* {{{ php_lookup_class_name */ PHPAPI zend_string *php_lookup_class_name(zend_object *object) { diff --git a/ext/standard/tests/serialize/incomplete_class_clone.phpt b/ext/standard/tests/serialize/incomplete_class_clone.phpt new file mode 100644 index 0000000000000..84f38edd47c95 --- /dev/null +++ b/ext/standard/tests/serialize/incomplete_class_clone.phpt @@ -0,0 +1,19 @@ +--TEST-- +__PHP_Incomplete_Class cannot be cloned +--FILE-- +isCloneable()); +var_dump(clone($o)); +?> +--EXPECTF-- +string(22) "__PHP_Incomplete_Class" +bool(false) + +Fatal error: Uncaught Error: Call to private method __PHP_Incomplete_Class::__clone() from global scope in %s:%d +Stack trace: +#0 {main} + thrown in %s on line %d diff --git a/ext/standard/tests/serialize/incomplete_class_constructor.phpt b/ext/standard/tests/serialize/incomplete_class_constructor.phpt new file mode 100644 index 0000000000000..de5df6b618a95 --- /dev/null +++ b/ext/standard/tests/serialize/incomplete_class_constructor.phpt @@ -0,0 +1,14 @@ +--TEST-- +__PHP_Incomplete_Class cannot be instantiated +--FILE-- + +--EXPECTF-- +string(22) "__PHP_Incomplete_Class" + +Fatal error: Uncaught Error: Call to private __PHP_Incomplete_Class::__construct() from global scope in %s:%d +Stack trace: +#0 {main} + thrown in %s on line %d diff --git a/ext/standard/tests/serialize/incomplete_class_newinstancewithoutconstructor.phpt b/ext/standard/tests/serialize/incomplete_class_newinstancewithoutconstructor.phpt new file mode 100644 index 0000000000000..9c76ae30da265 --- /dev/null +++ b/ext/standard/tests/serialize/incomplete_class_newinstancewithoutconstructor.phpt @@ -0,0 +1,12 @@ +--TEST-- +ReflectionClass::newInstanceWithoutConstructor cannot instantiate __PHP_Incomplete_Class +--FILE-- +newInstanceWithoutConstructor(); +--EXPECTF-- +Fatal error: Uncaught ReflectionException: Class __PHP_Incomplete_Class is an internal class marked as final that cannot be instantiated without invoking its constructor in %s:%d +Stack trace: +#0 %s(%d): ReflectionClass->newInstanceWithoutConstructor() +#1 {main} + thrown in %s on line %d From 3b43ec429e358c2d8ac833efe5ddbab5afe1e50d Mon Sep 17 00:00:00 2001 From: Jordi Kroon Date: Sun, 1 Mar 2026 20:00:48 +0100 Subject: [PATCH 2/5] update incomplete class serialization tests --- ext/standard/tests/serialize/incomplete_class.phpt | 13 ++++++++----- .../tests/serialize/serialization_objects_006.phpt | 8 +++++--- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/ext/standard/tests/serialize/incomplete_class.phpt b/ext/standard/tests/serialize/incomplete_class.phpt index 2ead760508cfe..24b0b228bcb20 100644 --- a/ext/standard/tests/serialize/incomplete_class.phpt +++ b/ext/standard/tests/serialize/incomplete_class.phpt @@ -3,7 +3,8 @@ --FILE-- test2); echo "Done\n"; ?> --EXPECTF-- -object(__PHP_Incomplete_Class)#%d (0) { +object(__PHP_Incomplete_Class)#%d (1) { + ["__PHP_Incomplete_Class_Name"]=> + string(7) "Unknown" } -The script tried to modify a property on an incomplete object. Please ensure that the class definition "unknown" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide an autoloader to load the class definition +The script tried to modify a property on an incomplete object. Please ensure that the class definition "Unknown" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide an autoloader to load the class definition -Warning: main(): The script tried to access a property on an incomplete object. Please ensure that the class definition "unknown" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide an autoloader to load the class definition in %s on line %d +Warning: main(): The script tried to access a property on an incomplete object. Please ensure that the class definition "Unknown" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide an autoloader to load the class definition in %s on line %d NULL -Warning: main(): The script tried to access a property on an incomplete object. Please ensure that the class definition "unknown" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide an autoloader to load the class definition in %s on line %d +Warning: main(): The script tried to access a property on an incomplete object. Please ensure that the class definition "Unknown" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide an autoloader to load the class definition in %s on line %d NULL Done diff --git a/ext/standard/tests/serialize/serialization_objects_006.phpt b/ext/standard/tests/serialize/serialization_objects_006.phpt index 131bf85658faa..292365b193918 100644 --- a/ext/standard/tests/serialize/serialization_objects_006.phpt +++ b/ext/standard/tests/serialize/serialization_objects_006.phpt @@ -2,16 +2,18 @@ Behaviour of incomplete class is preserved even when it was not created by unserialize(). --FILE-- p); echo "Done"; ?> --EXPECTF-- -object(__PHP_Incomplete_Class)#%d (0) { +object(__PHP_Incomplete_Class)#1 (1) { + ["__PHP_Incomplete_Class_Name"]=> + string(7) "Unknown" } -Warning: main(): The script tried to access a property on an incomplete object. Please ensure that the class definition "unknown" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide an autoloader to load the class definition in %s on line %d +Warning: main(): The script tried to access a property on an incomplete object. Please ensure that the class definition "Unknown" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide an autoloader to load the class definition in %s on line %d NULL Done From 3d46122e193215ad9bbf5c604e9f4f34300f30b6 Mon Sep 17 00:00:00 2001 From: Jordi Kroon Date: Sun, 1 Mar 2026 20:08:36 +0100 Subject: [PATCH 3/5] move incomplete_class_get_constructor up --- ext/standard/incomplete_class.c | 40 ++++++++++++++++----------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/ext/standard/incomplete_class.c b/ext/standard/incomplete_class.c index 149d3026a65eb..b50ae184fef72 100644 --- a/ext/standard/incomplete_class.c +++ b/ext/standard/incomplete_class.c @@ -95,6 +95,26 @@ static zend_function *incomplete_class_get_method(zend_object **object, zend_str } /* }}} */ +/* {{{ Private constructor preventing instantiation */ +static ZEND_COLD zend_function *incomplete_class_get_constructor(zend_object *object) /* {{{ */ +{ + zend_throw_error(NULL, "Instantiation of class Closure is not allowed"); + return NULL; +} + +ZEND_COLD ZEND_METHOD(__PHP_Incomplete_Class, __construct) +{ + zend_throw_error(NULL, "Instantiation of class __PHP_Incomplete_Class is not allowed"); +} +/* }}} */ + +/* {{{ Private clone preventing cloning */ +ZEND_COLD ZEND_METHOD(__PHP_Incomplete_Class, __clone) +{ + zend_throw_error(NULL, "Cannot clone __PHP_Incomplete_Class using __clone()"); +} +/* }}} */ + /* {{{ php_create_incomplete_class */ static zend_object *php_create_incomplete_object(zend_class_entry *class_type) { @@ -124,26 +144,6 @@ PHPAPI void php_register_incomplete_class_handlers(void) } /* }}} */ -/* {{{ Private constructor preventing instantiation */ -static ZEND_COLD zend_function *incomplete_class_get_constructor(zend_object *object) /* {{{ */ -{ - zend_throw_error(NULL, "Instantiation of class Closure is not allowed"); - return NULL; -} - -ZEND_COLD ZEND_METHOD(__PHP_Incomplete_Class, __construct) -{ - zend_throw_error(NULL, "Instantiation of class __PHP_Incomplete_Class is not allowed"); -} -/* }}} */ - -/* {{{ Private clone preventing cloning */ -ZEND_COLD ZEND_METHOD(__PHP_Incomplete_Class, __clone) -{ - zend_throw_error(NULL, "Cannot clone __PHP_Incomplete_Class using __clone()"); -} -/* }}} */ - /* {{{ php_lookup_class_name */ PHPAPI zend_string *php_lookup_class_name(zend_object *object) { From a689adabd5e5e21a94c13c87bef9bebffbd0abdd Mon Sep 17 00:00:00 2001 From: Jordi Kroon Date: Sun, 1 Mar 2026 20:21:15 +0100 Subject: [PATCH 4/5] remove __clone method from __PHP_Incomplete_Class, use .clone_obj --- ext/standard/basic_functions.stub.php | 1 - ext/standard/basic_functions_arginfo.h | 6 +----- ext/standard/basic_functions_decl.h | 8 ++++---- ext/standard/incomplete_class.c | 10 +++------- .../tests/serialize/incomplete_class_clone.phpt | 2 +- .../tests/serialize/incomplete_class_constructor.phpt | 2 +- 6 files changed, 10 insertions(+), 19 deletions(-) diff --git a/ext/standard/basic_functions.stub.php b/ext/standard/basic_functions.stub.php index 5b10f585fedaa..c6e129490bba7 100644 --- a/ext/standard/basic_functions.stub.php +++ b/ext/standard/basic_functions.stub.php @@ -1488,7 +1488,6 @@ final class __PHP_Incomplete_Class { private function __construct() {} - private function __clone(): void {} } class AssertionError extends Error diff --git a/ext/standard/basic_functions_arginfo.h b/ext/standard/basic_functions_arginfo.h index 174437f9f3b7f..1ef332e36a25a 100644 --- a/ext/standard/basic_functions_arginfo.h +++ b/ext/standard/basic_functions_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit basic_functions.stub.php instead. - * Stub hash: bf06c50808ee7aa18cf3a9135cb7d080a4622848 + * Stub hash: 905d53e204a8ab18d493d4730ec2bceb27dc98bb * Has decl header: yes */ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_set_time_limit, 0, 1, _IS_BOOL, 0) @@ -2193,8 +2193,6 @@ ZEND_END_ARG_INFO() #define arginfo_class___PHP_Incomplete_Class___construct arginfo_tmpfile -#define arginfo_class___PHP_Incomplete_Class___clone arginfo_flush - ZEND_FRAMELESS_FUNCTION(min, 2); static const zend_frameless_function_info frameless_function_infos_min[] = { @@ -2898,7 +2896,6 @@ ZEND_FUNCTION(sapi_windows_set_ctrl_handler); ZEND_FUNCTION(sapi_windows_generate_ctrl_event); #endif ZEND_METHOD(__PHP_Incomplete_Class, __construct); -ZEND_METHOD(__PHP_Incomplete_Class, __clone); static const zend_function_entry ext_functions[] = { ZEND_FE(set_time_limit, arginfo_set_time_limit) @@ -3517,7 +3514,6 @@ static const zend_function_entry ext_functions[] = { static const zend_function_entry class___PHP_Incomplete_Class_methods[] = { ZEND_ME(__PHP_Incomplete_Class, __construct, arginfo_class___PHP_Incomplete_Class___construct, ZEND_ACC_PRIVATE) - ZEND_ME(__PHP_Incomplete_Class, __clone, arginfo_class___PHP_Incomplete_Class___clone, ZEND_ACC_PRIVATE) ZEND_FE_END }; diff --git a/ext/standard/basic_functions_decl.h b/ext/standard/basic_functions_decl.h index a8fa76ccbc338..01b4d2bcdb248 100644 --- a/ext/standard/basic_functions_decl.h +++ b/ext/standard/basic_functions_decl.h @@ -1,8 +1,8 @@ /* This is a generated file, edit basic_functions.stub.php instead. - * Stub hash: bf06c50808ee7aa18cf3a9135cb7d080a4622848 */ + * Stub hash: 905d53e204a8ab18d493d4730ec2bceb27dc98bb */ -#ifndef ZEND_BASIC_FUNCTIONS_DECL_bf06c50808ee7aa18cf3a9135cb7d080a4622848_H -#define ZEND_BASIC_FUNCTIONS_DECL_bf06c50808ee7aa18cf3a9135cb7d080a4622848_H +#ifndef ZEND_BASIC_FUNCTIONS_DECL_905d53e204a8ab18d493d4730ec2bceb27dc98bb_H +#define ZEND_BASIC_FUNCTIONS_DECL_905d53e204a8ab18d493d4730ec2bceb27dc98bb_H typedef enum zend_enum_RoundingMode { ZEND_ENUM_RoundingMode_HalfAwayFromZero = 1, @@ -15,4 +15,4 @@ typedef enum zend_enum_RoundingMode { ZEND_ENUM_RoundingMode_PositiveInfinity = 8, } zend_enum_RoundingMode; -#endif /* ZEND_BASIC_FUNCTIONS_DECL_bf06c50808ee7aa18cf3a9135cb7d080a4622848_H */ +#endif /* ZEND_BASIC_FUNCTIONS_DECL_905d53e204a8ab18d493d4730ec2bceb27dc98bb_H */ diff --git a/ext/standard/incomplete_class.c b/ext/standard/incomplete_class.c index b50ae184fef72..e099429fd63f1 100644 --- a/ext/standard/incomplete_class.c +++ b/ext/standard/incomplete_class.c @@ -104,14 +104,9 @@ static ZEND_COLD zend_function *incomplete_class_get_constructor(zend_object *ob ZEND_COLD ZEND_METHOD(__PHP_Incomplete_Class, __construct) { - zend_throw_error(NULL, "Instantiation of class __PHP_Incomplete_Class is not allowed"); -} -/* }}} */ + ZEND_PARSE_PARAMETERS_NONE(); -/* {{{ Private clone preventing cloning */ -ZEND_COLD ZEND_METHOD(__PHP_Incomplete_Class, __clone) -{ - zend_throw_error(NULL, "Cannot clone __PHP_Incomplete_Class using __clone()"); + zend_throw_error(NULL, "Instantiation of class __PHP_Incomplete_Class is not allowed"); } /* }}} */ @@ -139,6 +134,7 @@ PHPAPI void php_register_incomplete_class_handlers(void) php_incomplete_object_handlers.write_property = incomplete_class_write_property; php_incomplete_object_handlers.get_property_ptr_ptr = incomplete_class_get_property_ptr_ptr; php_incomplete_object_handlers.get_method = incomplete_class_get_method; + php_incomplete_object_handlers.clone_obj = NULL; php_ce_incomplete_class->create_object = php_create_incomplete_object; } diff --git a/ext/standard/tests/serialize/incomplete_class_clone.phpt b/ext/standard/tests/serialize/incomplete_class_clone.phpt index 84f38edd47c95..0ddeb4fc5a5ea 100644 --- a/ext/standard/tests/serialize/incomplete_class_clone.phpt +++ b/ext/standard/tests/serialize/incomplete_class_clone.phpt @@ -13,7 +13,7 @@ var_dump(clone($o)); string(22) "__PHP_Incomplete_Class" bool(false) -Fatal error: Uncaught Error: Call to private method __PHP_Incomplete_Class::__clone() from global scope in %s:%d +Fatal error: Uncaught Error: Trying to clone an uncloneable object of class __PHP_Incomplete_Class in %s:%d Stack trace: #0 {main} thrown in %s on line %d diff --git a/ext/standard/tests/serialize/incomplete_class_constructor.phpt b/ext/standard/tests/serialize/incomplete_class_constructor.phpt index de5df6b618a95..57a12e6028767 100644 --- a/ext/standard/tests/serialize/incomplete_class_constructor.phpt +++ b/ext/standard/tests/serialize/incomplete_class_constructor.phpt @@ -8,7 +8,7 @@ var_dump(new __PHP_Incomplete_Class()); --EXPECTF-- string(22) "__PHP_Incomplete_Class" -Fatal error: Uncaught Error: Call to private __PHP_Incomplete_Class::__construct() from global scope in %s:%d +Fatal error: Uncaught Error: Instantiation of class Closure is not allowed in %s:%d Stack trace: #0 {main} thrown in %s on line %d From 6ef203a29def4987581fe68fdf737b4f69883e0c Mon Sep 17 00:00:00 2001 From: Jordi Kroon Date: Mon, 2 Mar 2026 12:55:27 +0100 Subject: [PATCH 5/5] correct error message for incomplete class instantiation --- ext/standard/incomplete_class.c | 2 +- ext/standard/tests/serialize/incomplete_class_constructor.phpt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/standard/incomplete_class.c b/ext/standard/incomplete_class.c index e099429fd63f1..65a903833573f 100644 --- a/ext/standard/incomplete_class.c +++ b/ext/standard/incomplete_class.c @@ -98,7 +98,7 @@ static zend_function *incomplete_class_get_method(zend_object **object, zend_str /* {{{ Private constructor preventing instantiation */ static ZEND_COLD zend_function *incomplete_class_get_constructor(zend_object *object) /* {{{ */ { - zend_throw_error(NULL, "Instantiation of class Closure is not allowed"); + zend_throw_error(NULL, "Instantiation of class __PHP_Incomplete_Class is not allowed"); return NULL; } diff --git a/ext/standard/tests/serialize/incomplete_class_constructor.phpt b/ext/standard/tests/serialize/incomplete_class_constructor.phpt index 57a12e6028767..1cd0db5426a38 100644 --- a/ext/standard/tests/serialize/incomplete_class_constructor.phpt +++ b/ext/standard/tests/serialize/incomplete_class_constructor.phpt @@ -8,7 +8,7 @@ var_dump(new __PHP_Incomplete_Class()); --EXPECTF-- string(22) "__PHP_Incomplete_Class" -Fatal error: Uncaught Error: Instantiation of class Closure is not allowed in %s:%d +Fatal error: Uncaught Error: Instantiation of class __PHP_Incomplete_Class is not allowed in %s:%d Stack trace: #0 {main} thrown in %s on line %d