diff --git a/Zend/tests/weakrefs/weakrefs_002.phpt b/Zend/tests/weakrefs/weakrefs_002.phpt index f550302aeca..eda6b25ec78 100644 --- a/Zend/tests/weakrefs/weakrefs_002.phpt +++ b/Zend/tests/weakrefs/weakrefs_002.phpt @@ -12,8 +12,12 @@ try { $wrs = 'O:13:"WeakReference":0:{}'; -var_dump(@unserialize($wrs)); +try { + var_dump(unserialize($wrs)); +} catch (Exception $ex) { + var_dump($ex->getMessage()); +} ?> --EXPECT-- string(47) "Serialization of 'WeakReference' is not allowed" -bool(false) +string(49) "Unserialization of 'WeakReference' is not allowed" diff --git a/Zend/zend_weakrefs.c b/Zend/zend_weakrefs.c index 521954d0b76..b08e9734391 100644 --- a/Zend/zend_weakrefs.c +++ b/Zend/zend_weakrefs.c @@ -604,8 +604,6 @@ void zend_register_weakref_ce(void) /* {{{ */ zend_ce_weakref = register_class_WeakReference(); zend_ce_weakref->create_object = zend_weakref_new; - zend_ce_weakref->serialize = zend_class_serialize_deny; - zend_ce_weakref->unserialize = zend_class_unserialize_deny; memcpy(&zend_weakref_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers)); zend_weakref_handlers.offset = XtOffsetOf(zend_weakref, std); @@ -617,8 +615,6 @@ void zend_register_weakref_ce(void) /* {{{ */ zend_ce_weakmap->create_object = zend_weakmap_create_object; zend_ce_weakmap->get_iterator = zend_weakmap_get_iterator; - zend_ce_weakmap->serialize = zend_class_serialize_deny; - zend_ce_weakmap->unserialize = zend_class_unserialize_deny; memcpy(&zend_weakmap_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers)); zend_weakmap_handlers.offset = XtOffsetOf(zend_weakmap, std); diff --git a/Zend/zend_weakrefs.stub.php b/Zend/zend_weakrefs.stub.php index 85c8126a683..3c3d0a84603 100644 --- a/Zend/zend_weakrefs.stub.php +++ b/Zend/zend_weakrefs.stub.php @@ -2,7 +2,10 @@ /** @generate-class-entries */ -/** @strict-properties */ +/** + * @strict-properties + * @not-serializable + */ final class WeakReference { public function __construct() {} @@ -12,7 +15,10 @@ final class WeakReference public function get(): ?object {} } -/** @strict-properties */ +/** + * @strict-properties + * @not-serializable + */ final class WeakMap implements ArrayAccess, Countable, IteratorAggregate { /** @param object $object */ diff --git a/Zend/zend_weakrefs_arginfo.h b/Zend/zend_weakrefs_arginfo.h index 5d1fc0191f6..6bf859e46e4 100644 --- a/Zend/zend_weakrefs_arginfo.h +++ b/Zend/zend_weakrefs_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: c849da0cac9ed05fedacf10ef57449a4596b3c07 */ + * Stub hash: d91889851d9732d41e43fffddb6235d033c67534 */ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_WeakReference___construct, 0, 0, 0) ZEND_END_ARG_INFO() @@ -70,7 +70,7 @@ static zend_class_entry *register_class_WeakReference(void) INIT_CLASS_ENTRY(ce, "WeakReference", class_WeakReference_methods); class_entry = zend_register_internal_class_ex(&ce, NULL); - class_entry->ce_flags |= ZEND_ACC_FINAL|ZEND_ACC_NO_DYNAMIC_PROPERTIES; + class_entry->ce_flags |= ZEND_ACC_FINAL|ZEND_ACC_NO_DYNAMIC_PROPERTIES|ZEND_ACC_NOT_SERIALIZABLE; return class_entry; } @@ -81,7 +81,7 @@ static zend_class_entry *register_class_WeakMap(zend_class_entry *class_entry_Ar INIT_CLASS_ENTRY(ce, "WeakMap", class_WeakMap_methods); class_entry = zend_register_internal_class_ex(&ce, NULL); - class_entry->ce_flags |= ZEND_ACC_FINAL|ZEND_ACC_NO_DYNAMIC_PROPERTIES; + class_entry->ce_flags |= ZEND_ACC_FINAL|ZEND_ACC_NO_DYNAMIC_PROPERTIES|ZEND_ACC_NOT_SERIALIZABLE; zend_class_implements(class_entry, 3, class_entry_ArrayAccess, class_entry_Countable, class_entry_IteratorAggregate); return class_entry; diff --git a/ext/com_dotnet/com_extension.c b/ext/com_dotnet/com_extension.c index 6ed79e4da52..55b3c282aee 100644 --- a/ext/com_dotnet/com_extension.c +++ b/ext/com_dotnet/com_extension.c @@ -174,21 +174,15 @@ PHP_MINIT_FUNCTION(com_dotnet) php_com_variant_class_entry = register_class_variant(); php_com_variant_class_entry->create_object = php_com_object_new; php_com_variant_class_entry->get_iterator = php_com_iter_get; - php_com_variant_class_entry->serialize = zend_class_serialize_deny; - php_com_variant_class_entry->unserialize = zend_class_unserialize_deny; tmp = register_class_com(php_com_variant_class_entry); tmp->create_object = php_com_object_new; tmp->get_iterator = php_com_iter_get; - tmp->serialize = zend_class_serialize_deny; - tmp->unserialize = zend_class_unserialize_deny; #if HAVE_MSCOREE_H tmp = register_class_dotnet(php_com_variant_class_entry); tmp->create_object = php_com_object_new; tmp->get_iterator = php_com_iter_get; - tmp->serialize = zend_class_serialize_deny; - tmp->unserialize = zend_class_unserialize_deny; #endif REGISTER_INI_ENTRIES(); diff --git a/ext/com_dotnet/com_extension.stub.php b/ext/com_dotnet/com_extension.stub.php index 8c46f319b95..3d9fada7fa7 100644 --- a/ext/com_dotnet/com_extension.stub.php +++ b/ext/com_dotnet/com_extension.stub.php @@ -66,6 +66,9 @@ function com_message_pump(int $timeout_milliseconds = 0): bool {} function com_load_typelib(string $typelib, bool $case_insensitive = true): bool {} +/** + * @not-serializable + */ class variant { public function __construct(mixed $value = null, int $type = VT_EMPTY, int $codepage = CP_ACP) {} diff --git a/ext/com_dotnet/com_extension_arginfo.h b/ext/com_dotnet/com_extension_arginfo.h index cf9a08e7111..d7a716635c4 100644 --- a/ext/com_dotnet/com_extension_arginfo.h +++ b/ext/com_dotnet/com_extension_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: ba77cee0a718bcbe7ac280f07a41f9e97a8e2246 */ + * Stub hash: a2e260364d3f1f0e632b43be1a61294b21eed937 */ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_variant_set, 0, 2, IS_VOID, 0) ZEND_ARG_OBJ_INFO(0, variant, variant, 0) @@ -243,6 +243,7 @@ static zend_class_entry *register_class_variant(void) INIT_CLASS_ENTRY(ce, "variant", class_variant_methods); class_entry = zend_register_internal_class_ex(&ce, NULL); + class_entry->ce_flags |= ZEND_ACC_NOT_SERIALIZABLE; return class_entry; } diff --git a/ext/com_dotnet/tests/bug77177.phpt b/ext/com_dotnet/tests/bug77177.phpt index 19e4c11995c..41105f24153 100644 --- a/ext/com_dotnet/tests/bug77177.phpt +++ b/ext/com_dotnet/tests/bug77177.phpt @@ -26,7 +26,11 @@ foreach ($strings as $string) { $strings = ['O:3:"com":0:{}', 'O:6:"dotnet":0:{}', 'O:7:"variant":0:{}']; foreach ($strings as $string) { - var_dump(unserialize($string)); + try { + unserialize($string); + } catch (Exception $ex) { + echo "Exception: {$ex->getMessage()}\n"; + } } ?> --EXPECTF-- @@ -36,18 +40,6 @@ Exception: Serialization of 'variant' is not allowed Exception: Unserialization of 'com' is not allowed Exception: Unserialization of 'dotnet' is not allowed Exception: Unserialization of 'variant' is not allowed - -Warning: Erroneous data format for unserializing 'com' in %s on line %d - -Notice: unserialize(): Error at offset 13 of 14 bytes in %s on line %d -bool(false) - -Warning: Erroneous data format for unserializing 'dotnet' in %s on line %d - -Notice: unserialize(): Error at offset 16 of 17 bytes in %s on line %d -bool(false) - -Warning: Erroneous data format for unserializing 'variant' in %s on line %d - -Notice: unserialize(): Error at offset 17 of 18 bytes in %s on line %d -bool(false) +Exception: Unserialization of 'com' is not allowed +Exception: Unserialization of 'dotnet' is not allowed +Exception: Unserialization of 'variant' is not allowed diff --git a/ext/curl/curl.stub.php b/ext/curl/curl.stub.php index 20941f978c3..5a7a2fa6ae5 100644 --- a/ext/curl/curl.stub.php +++ b/ext/curl/curl.stub.php @@ -2,17 +2,26 @@ /** @generate-class-entries */ -/** @strict-properties */ +/** + * @strict-properties + * @not-serializable + */ final class CurlHandle { } -/** @strict-properties */ +/** + * @strict-properties + * @not-serializable + */ final class CurlMultiHandle { } -/** @strict-properties */ +/** + * @strict-properties + * @not-serializable + */ final class CurlShareHandle { } diff --git a/ext/curl/curl_arginfo.h b/ext/curl/curl_arginfo.h index 78fcae94111..37489817be7 100644 --- a/ext/curl/curl_arginfo.h +++ b/ext/curl/curl_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 0b574385806ffec3ad96c1b584778cb53bd42535 */ + * Stub hash: c667191d35c8822b6e1f38ddd1e2743e78d4c3c0 */ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_curl_close, 0, 1, IS_VOID, 0) ZEND_ARG_OBJ_INFO(0, handle, CurlHandle, 0) @@ -224,7 +224,7 @@ static zend_class_entry *register_class_CurlHandle(void) INIT_CLASS_ENTRY(ce, "CurlHandle", class_CurlHandle_methods); class_entry = zend_register_internal_class_ex(&ce, NULL); - class_entry->ce_flags |= ZEND_ACC_FINAL|ZEND_ACC_NO_DYNAMIC_PROPERTIES; + class_entry->ce_flags |= ZEND_ACC_FINAL|ZEND_ACC_NO_DYNAMIC_PROPERTIES|ZEND_ACC_NOT_SERIALIZABLE; return class_entry; } @@ -235,7 +235,7 @@ static zend_class_entry *register_class_CurlMultiHandle(void) INIT_CLASS_ENTRY(ce, "CurlMultiHandle", class_CurlMultiHandle_methods); class_entry = zend_register_internal_class_ex(&ce, NULL); - class_entry->ce_flags |= ZEND_ACC_FINAL|ZEND_ACC_NO_DYNAMIC_PROPERTIES; + class_entry->ce_flags |= ZEND_ACC_FINAL|ZEND_ACC_NO_DYNAMIC_PROPERTIES|ZEND_ACC_NOT_SERIALIZABLE; return class_entry; } @@ -246,7 +246,7 @@ static zend_class_entry *register_class_CurlShareHandle(void) INIT_CLASS_ENTRY(ce, "CurlShareHandle", class_CurlShareHandle_methods); class_entry = zend_register_internal_class_ex(&ce, NULL); - class_entry->ce_flags |= ZEND_ACC_FINAL|ZEND_ACC_NO_DYNAMIC_PROPERTIES; + class_entry->ce_flags |= ZEND_ACC_FINAL|ZEND_ACC_NO_DYNAMIC_PROPERTIES|ZEND_ACC_NOT_SERIALIZABLE; return class_entry; } diff --git a/ext/curl/curl_file.c b/ext/curl/curl_file.c index 3210349ed61..1097411d763 100644 --- a/ext/curl/curl_file.c +++ b/ext/curl/curl_file.c @@ -20,7 +20,6 @@ #include "php.h" #include "Zend/zend_exceptions.h" -#include "Zend/zend_interfaces.h" #include "curl_private.h" #include "curl_file_arginfo.h" @@ -147,8 +146,6 @@ ZEND_METHOD(CURLStringFile, __construct) void curlfile_register_class(void) { curl_CURLFile_class = register_class_CURLFile(); - curl_CURLFile_class->serialize = zend_class_serialize_deny; - curl_CURLFile_class->unserialize = zend_class_unserialize_deny; curl_CURLStringFile_class = register_class_CURLStringFile(); } diff --git a/ext/curl/curl_file.stub.php b/ext/curl/curl_file.stub.php index ccaf09d88e1..26c9e558a49 100644 --- a/ext/curl/curl_file.stub.php +++ b/ext/curl/curl_file.stub.php @@ -2,6 +2,9 @@ /** @generate-class-entries */ +/** + * @not-serializable + */ class CURLFile { public string $name = ""; diff --git a/ext/curl/curl_file_arginfo.h b/ext/curl/curl_file_arginfo.h index 963ae117190..fb16fffe7aa 100644 --- a/ext/curl/curl_file_arginfo.h +++ b/ext/curl/curl_file_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 6cc8d65814e0a45d71cdf765533e85353e749051 */ + * Stub hash: 63d47eac83ee088e8b4c0d1aa469de9ae066146a */ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_CURLFile___construct, 0, 0, 1) ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0) @@ -60,6 +60,7 @@ static zend_class_entry *register_class_CURLFile(void) INIT_CLASS_ENTRY(ce, "CURLFile", class_CURLFile_methods); class_entry = zend_register_internal_class_ex(&ce, NULL); + class_entry->ce_flags |= ZEND_ACC_NOT_SERIALIZABLE; zval property_name_default_value; ZVAL_EMPTY_STRING(&property_name_default_value); diff --git a/ext/curl/interface.c b/ext/curl/interface.c index b0e2b6170c0..9ab7a41201f 100644 --- a/ext/curl/interface.c +++ b/ext/curl/interface.c @@ -21,7 +21,6 @@ #endif #include "php.h" -#include "Zend/zend_interfaces.h" #include "Zend/zend_exceptions.h" #include @@ -1189,8 +1188,6 @@ PHP_MINIT_FUNCTION(curl) curl_ce = register_class_CurlHandle(); curl_ce->create_object = curl_create_object; - curl_ce->serialize = zend_class_serialize_deny; - curl_ce->unserialize = zend_class_unserialize_deny; memcpy(&curl_object_handlers, &std_object_handlers, sizeof(zend_object_handlers)); curl_object_handlers.offset = XtOffsetOf(php_curl, std); diff --git a/ext/curl/multi.c b/ext/curl/multi.c index d0eddb4feec..379f81991e3 100644 --- a/ext/curl/multi.c +++ b/ext/curl/multi.c @@ -21,7 +21,6 @@ #endif #include "php.h" -#include "Zend/zend_interfaces.h" #include "Zend/zend_smart_str.h" #include "curl_private.h" @@ -582,8 +581,6 @@ static HashTable *curl_multi_get_gc(zend_object *object, zval **table, int *n) void curl_multi_register_handlers(void) { curl_multi_ce->create_object = curl_multi_create_object; - curl_multi_ce->serialize = zend_class_serialize_deny; - curl_multi_ce->unserialize = zend_class_unserialize_deny; memcpy(&curl_multi_handlers, &std_object_handlers, sizeof(zend_object_handlers)); curl_multi_handlers.offset = XtOffsetOf(php_curlm, std); diff --git a/ext/curl/share.c b/ext/curl/share.c index 04593318383..fa4226277d2 100644 --- a/ext/curl/share.c +++ b/ext/curl/share.c @@ -21,7 +21,6 @@ #endif #include "php.h" -#include "Zend/zend_interfaces.h" #include "curl_private.h" @@ -164,8 +163,6 @@ void curl_share_free_obj(zend_object *object) void curl_share_register_handlers(void) { curl_share_ce->create_object = curl_share_create_object; - curl_share_ce->serialize = &zend_class_serialize_deny; - curl_share_ce->unserialize = &zend_class_unserialize_deny; memcpy(&curl_share_handlers, &std_object_handlers, sizeof(zend_object_handlers)); curl_share_handlers.offset = XtOffsetOf(php_curlsh, std); diff --git a/ext/curl/tests/bug73147.phpt b/ext/curl/tests/bug73147.phpt index 2c50afa371f..b0f01e64e31 100644 --- a/ext/curl/tests/bug73147.phpt +++ b/ext/curl/tests/bug73147.phpt @@ -4,7 +4,6 @@ Bug #73147: Use After Free in PHP7 unserialize() curl --FILE-- getMessage(); } ?> ---EXPECTF-- -Warning: Erroneous data format for unserializing 'CURLFile' in %s on line %d - -Notice: unserialize(): Error at offset 27 of 44 bytes in %s on line %d -bool(false) +--EXPECT-- +Unserialization of 'CURLFile' is not allowed diff --git a/ext/enchant/enchant.c b/ext/enchant/enchant.c index 1106918f9fe..dfdd55a4c77 100644 --- a/ext/enchant/enchant.c +++ b/ext/enchant/enchant.c @@ -22,7 +22,6 @@ #include "php.h" #include "php_ini.h" #include "ext/standard/info.h" -#include "Zend/zend_interfaces.h" #include "Zend/zend_exceptions.h" #include "../spl/spl_exceptions.h" #include @@ -188,8 +187,6 @@ PHP_MINIT_FUNCTION(enchant) { enchant_broker_ce = register_class_EnchantBroker(); enchant_broker_ce->create_object = enchant_broker_create_object; - enchant_broker_ce->serialize = zend_class_serialize_deny; - enchant_broker_ce->unserialize = zend_class_unserialize_deny; memcpy(&enchant_broker_handlers, &std_object_handlers, sizeof(zend_object_handlers)); enchant_broker_handlers.offset = XtOffsetOf(enchant_broker, std); @@ -199,8 +196,6 @@ PHP_MINIT_FUNCTION(enchant) enchant_dict_ce = register_class_EnchantDictionary(); enchant_dict_ce->create_object = enchant_dict_create_object; - enchant_dict_ce->serialize = zend_class_serialize_deny; - enchant_dict_ce->unserialize = zend_class_unserialize_deny; memcpy(&enchant_dict_handlers, &std_object_handlers, sizeof(zend_object_handlers)); enchant_dict_handlers.offset = XtOffsetOf(enchant_dict, std); diff --git a/ext/enchant/enchant.stub.php b/ext/enchant/enchant.stub.php index 3e7b1e87ae5..22351eafcc8 100644 --- a/ext/enchant/enchant.stub.php +++ b/ext/enchant/enchant.stub.php @@ -2,12 +2,18 @@ /** @generate-class-entries */ -/** @strict-properties */ +/** + * @strict-properties + * @not-serializable + */ final class EnchantBroker { } -/** @strict-properties */ +/** + * @strict-properties + * @not-serializable + */ final class EnchantDictionary { } diff --git a/ext/enchant/enchant_arginfo.h b/ext/enchant/enchant_arginfo.h index b8902b32ce6..f5f93b5dd71 100644 --- a/ext/enchant/enchant_arginfo.h +++ b/ext/enchant/enchant_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: b55b5d39b48d38af9c28bd810c77adcda466f1bd */ + * Stub hash: 27bafa980508d1a30073d9b009060a7a1953f5af */ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_enchant_broker_init, 0, 0, EnchantBroker, MAY_BE_FALSE) ZEND_END_ARG_INFO() @@ -164,7 +164,7 @@ static zend_class_entry *register_class_EnchantBroker(void) INIT_CLASS_ENTRY(ce, "EnchantBroker", class_EnchantBroker_methods); class_entry = zend_register_internal_class_ex(&ce, NULL); - class_entry->ce_flags |= ZEND_ACC_FINAL|ZEND_ACC_NO_DYNAMIC_PROPERTIES; + class_entry->ce_flags |= ZEND_ACC_FINAL|ZEND_ACC_NO_DYNAMIC_PROPERTIES|ZEND_ACC_NOT_SERIALIZABLE; return class_entry; } @@ -175,7 +175,7 @@ static zend_class_entry *register_class_EnchantDictionary(void) INIT_CLASS_ENTRY(ce, "EnchantDictionary", class_EnchantDictionary_methods); class_entry = zend_register_internal_class_ex(&ce, NULL); - class_entry->ce_flags |= ZEND_ACC_FINAL|ZEND_ACC_NO_DYNAMIC_PROPERTIES; + class_entry->ce_flags |= ZEND_ACC_FINAL|ZEND_ACC_NO_DYNAMIC_PROPERTIES|ZEND_ACC_NOT_SERIALIZABLE; return class_entry; } diff --git a/ext/ffi/ffi.c b/ext/ffi/ffi.c index 1aabd9e030c..963df0671a0 100644 --- a/ext/ffi/ffi.c +++ b/ext/ffi/ffi.c @@ -23,7 +23,6 @@ #include "ext/standard/info.h" #include "php_scandir.h" #include "zend_exceptions.h" -#include "zend_interfaces.h" #include "zend_closures.h" #include "main/SAPI.h" #include "ffi_arginfo.h" @@ -5224,8 +5223,6 @@ ZEND_MINIT_FUNCTION(ffi) zend_ffi_ce = register_class_FFI(); zend_ffi_ce->create_object = zend_ffi_new; - zend_ffi_ce->serialize = zend_class_serialize_deny; - zend_ffi_ce->unserialize = zend_class_unserialize_deny; memcpy(&zend_ffi_new_fn, zend_hash_str_find_ptr(&zend_ffi_ce->function_table, "new", sizeof("new")-1), sizeof(zend_internal_function)); zend_ffi_new_fn.fn_flags &= ~ZEND_ACC_STATIC; @@ -5260,8 +5257,6 @@ ZEND_MINIT_FUNCTION(ffi) zend_ffi_cdata_ce = register_class_FFI_CData(); zend_ffi_cdata_ce->create_object = zend_ffi_cdata_new; zend_ffi_cdata_ce->get_iterator = zend_ffi_cdata_get_iterator; - zend_ffi_cdata_ce->serialize = zend_class_serialize_deny; - zend_ffi_cdata_ce->unserialize = zend_class_unserialize_deny; memcpy(&zend_ffi_cdata_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers)); zend_ffi_cdata_handlers.get_constructor = zend_fake_get_constructor; @@ -5335,8 +5330,6 @@ ZEND_MINIT_FUNCTION(ffi) zend_ffi_ctype_ce = register_class_FFI_CType(); zend_ffi_ctype_ce->create_object = zend_ffi_ctype_new; - zend_ffi_ctype_ce->serialize = zend_class_serialize_deny; - zend_ffi_ctype_ce->unserialize = zend_class_unserialize_deny; memcpy(&zend_ffi_ctype_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers)); zend_ffi_ctype_handlers.get_constructor = zend_fake_get_constructor; diff --git a/ext/ffi/ffi.stub.php b/ext/ffi/ffi.stub.php index 14fc3b251a1..72ae4a7e192 100644 --- a/ext/ffi/ffi.stub.php +++ b/ext/ffi/ffi.stub.php @@ -4,6 +4,9 @@ namespace { + /** + * @not-serializable + */ final class FFI { public static function cdef(string $code = "", ?string $lib = null): FFI {} @@ -67,10 +70,15 @@ namespace { } namespace FFI { - + /** + * @not-serializable + */ final class CData { } + /** + * @not-serializable + */ final class CType { public function getName(): string {} diff --git a/ext/ffi/ffi_arginfo.h b/ext/ffi/ffi_arginfo.h index 2eb6528b0b6..bee1dbe73f7 100644 --- a/ext/ffi/ffi_arginfo.h +++ b/ext/ffi/ffi_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: c71ceb0ba6966559887dc7785da3840ad60f7ded */ + * Stub hash: a5c742bba32bd234e89268bebfc13f3cb4177719 */ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_FFI_cdef, 0, 0, FFI, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, code, IS_STRING, 0, "\"\"") @@ -220,7 +220,7 @@ static zend_class_entry *register_class_FFI(void) INIT_CLASS_ENTRY(ce, "FFI", class_FFI_methods); class_entry = zend_register_internal_class_ex(&ce, NULL); - class_entry->ce_flags |= ZEND_ACC_FINAL; + class_entry->ce_flags |= ZEND_ACC_FINAL|ZEND_ACC_NOT_SERIALIZABLE; return class_entry; } @@ -231,7 +231,7 @@ static zend_class_entry *register_class_FFI_CData(void) INIT_NS_CLASS_ENTRY(ce, "FFI", "CData", class_FFI_CData_methods); class_entry = zend_register_internal_class_ex(&ce, NULL); - class_entry->ce_flags |= ZEND_ACC_FINAL; + class_entry->ce_flags |= ZEND_ACC_FINAL|ZEND_ACC_NOT_SERIALIZABLE; return class_entry; } @@ -242,7 +242,7 @@ static zend_class_entry *register_class_FFI_CType(void) INIT_NS_CLASS_ENTRY(ce, "FFI", "CType", class_FFI_CType_methods); class_entry = zend_register_internal_class_ex(&ce, NULL); - class_entry->ce_flags |= ZEND_ACC_FINAL; + class_entry->ce_flags |= ZEND_ACC_FINAL|ZEND_ACC_NOT_SERIALIZABLE; return class_entry; } diff --git a/ext/fileinfo/fileinfo.c b/ext/fileinfo/fileinfo.c index ee36e8c7d57..f7868514531 100644 --- a/ext/fileinfo/fileinfo.c +++ b/ext/fileinfo/fileinfo.c @@ -35,7 +35,6 @@ #include "fileinfo_arginfo.h" #include "fopen_wrappers.h" /* needed for is_url */ #include "Zend/zend_exceptions.h" -#include "Zend/zend_interfaces.h" /* {{{ macros and type definitions */ typedef struct _php_fileinfo { @@ -109,8 +108,6 @@ PHP_MINIT_FUNCTION(finfo) { finfo_class_entry = register_class_finfo(); finfo_class_entry->create_object = finfo_objects_new; - finfo_class_entry->serialize = zend_class_serialize_deny; - finfo_class_entry->unserialize = zend_class_unserialize_deny; /* copy the standard object handlers to you handler table */ memcpy(&finfo_object_handlers, &std_object_handlers, sizeof(zend_object_handlers)); diff --git a/ext/fileinfo/fileinfo.stub.php b/ext/fileinfo/fileinfo.stub.php index 1e11f0a2b55..dea0041f359 100644 --- a/ext/fileinfo/fileinfo.stub.php +++ b/ext/fileinfo/fileinfo.stub.php @@ -2,6 +2,9 @@ /** @generate-class-entries */ +/** + * @not-serializable + */ class finfo { /** @alias finfo_open */ diff --git a/ext/fileinfo/fileinfo_arginfo.h b/ext/fileinfo/fileinfo_arginfo.h index 4dcf17675b5..f2e087fecbf 100644 --- a/ext/fileinfo/fileinfo_arginfo.h +++ b/ext/fileinfo/fileinfo_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 933465e008723d0991761b5779a80e5c72248a9c */ + * Stub hash: 41527cacd680ee2e9657d0a1a39614567d356d83 */ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_finfo_open, 0, 0, finfo, MAY_BE_FALSE) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "FILEINFO_NONE") @@ -88,6 +88,7 @@ static zend_class_entry *register_class_finfo(void) INIT_CLASS_ENTRY(ce, "finfo", class_finfo_methods); class_entry = zend_register_internal_class_ex(&ce, NULL); + class_entry->ce_flags |= ZEND_ACC_NOT_SERIALIZABLE; return class_entry; } diff --git a/ext/ftp/ftp.stub.php b/ext/ftp/ftp.stub.php index de6557aca38..0c6b1c5b697 100644 --- a/ext/ftp/ftp.stub.php +++ b/ext/ftp/ftp.stub.php @@ -4,7 +4,10 @@ namespace FTP { - /** @strict-properties */ + /** + * @strict-properties + * @not-serializable + */ final class Connection { } diff --git a/ext/ftp/ftp_arginfo.h b/ext/ftp/ftp_arginfo.h index f58630243c1..68ee18b3812 100644 --- a/ext/ftp/ftp_arginfo.h +++ b/ext/ftp/ftp_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 76ede60b204ea03938cde1d71c58defd537ab4c0 */ + * Stub hash: bfc9846eb1f74990ec9b406728efff66fe49295f */ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_ftp_connect, 0, 1, FTP\\Connection, MAY_BE_FALSE) ZEND_ARG_TYPE_INFO(0, hostname, IS_STRING, 0) @@ -286,7 +286,7 @@ static zend_class_entry *register_class_FTP_Connection(void) INIT_NS_CLASS_ENTRY(ce, "FTP", "Connection", class_FTP_Connection_methods); class_entry = zend_register_internal_class_ex(&ce, NULL); - class_entry->ce_flags |= ZEND_ACC_FINAL|ZEND_ACC_NO_DYNAMIC_PROPERTIES; + class_entry->ce_flags |= ZEND_ACC_FINAL|ZEND_ACC_NO_DYNAMIC_PROPERTIES|ZEND_ACC_NOT_SERIALIZABLE; return class_entry; } diff --git a/ext/ftp/php_ftp.c b/ext/ftp/php_ftp.c index d24c409e838..d63da51fba8 100644 --- a/ext/ftp/php_ftp.c +++ b/ext/ftp/php_ftp.c @@ -30,7 +30,6 @@ #include "ext/standard/info.h" #include "ext/standard/file.h" #include "Zend/zend_exceptions.h" -#include "Zend/zend_interfaces.h" #include "php_ftp.h" #include "ftp.h" @@ -112,8 +111,6 @@ PHP_MINIT_FUNCTION(ftp) php_ftp_ce = register_class_FTP_Connection(); php_ftp_ce->create_object = ftp_object_create; - php_ftp_ce->serialize = zend_class_serialize_deny; - php_ftp_ce->unserialize = zend_class_unserialize_deny; memcpy(&ftp_object_handlers, &std_object_handlers, sizeof(zend_object_handlers)); ftp_object_handlers.offset = XtOffsetOf(php_ftp_object, std); diff --git a/ext/gd/gd.c b/ext/gd/gd.c index 6634ec8b851..0ecee9445ed 100644 --- a/ext/gd/gd.c +++ b/ext/gd/gd.c @@ -36,7 +36,6 @@ #include "php_open_temporary_file.h" #include "php_memory_streams.h" #include "zend_object_handlers.h" -#include "zend_interfaces.h" #ifdef HAVE_SYS_WAIT_H # include @@ -230,8 +229,6 @@ static void php_gd_object_minit_helper(void) { gd_image_ce = register_class_GdImage(); gd_image_ce->create_object = php_gd_image_object_create; - gd_image_ce->serialize = zend_class_serialize_deny; - gd_image_ce->unserialize = zend_class_unserialize_deny; /* setting up the object handlers for the GdImage class */ memcpy(&php_gd_image_object_handlers, &std_object_handlers, sizeof(zend_object_handlers)); @@ -298,8 +295,6 @@ static void php_gd_font_minit_helper() { gd_font_ce = register_class_GdFont(); gd_font_ce->create_object = php_gd_font_object_create; - gd_font_ce->serialize = zend_class_serialize_deny; - gd_font_ce->unserialize = zend_class_unserialize_deny; /* setting up the object handlers for the GdFont class */ memcpy(&php_gd_font_object_handlers, &std_object_handlers, sizeof(zend_object_handlers)); diff --git a/ext/gd/gd.stub.php b/ext/gd/gd.stub.php index 5e39ef83cd5..21fff247bd6 100644 --- a/ext/gd/gd.stub.php +++ b/ext/gd/gd.stub.php @@ -2,9 +2,16 @@ /** @generate-class-entries */ -/** @strict-properties */ +/** + * @strict-properties + * @not-serializable + */ final class GdImage {} -/** @strict-properties */ + +/** + * @strict-properties + * @not-serializable + */ final class GdFont {} function gd_info(): array {} diff --git a/ext/gd/gd_arginfo.h b/ext/gd/gd_arginfo.h index 2ac7362710b..b708689e04e 100644 --- a/ext/gd/gd_arginfo.h +++ b/ext/gd/gd_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 5680b763385b8608dbe797853f83c0e49890737e */ + * Stub hash: efd64c0da5f3f970e3e776b112d09fff080b3798 */ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_gd_info, 0, 0, IS_ARRAY, 0) ZEND_END_ARG_INFO() @@ -881,7 +881,7 @@ static zend_class_entry *register_class_GdImage(void) INIT_CLASS_ENTRY(ce, "GdImage", class_GdImage_methods); class_entry = zend_register_internal_class_ex(&ce, NULL); - class_entry->ce_flags |= ZEND_ACC_FINAL|ZEND_ACC_NO_DYNAMIC_PROPERTIES; + class_entry->ce_flags |= ZEND_ACC_FINAL|ZEND_ACC_NO_DYNAMIC_PROPERTIES|ZEND_ACC_NOT_SERIALIZABLE; return class_entry; } @@ -892,7 +892,7 @@ static zend_class_entry *register_class_GdFont(void) INIT_CLASS_ENTRY(ce, "GdFont", class_GdFont_methods); class_entry = zend_register_internal_class_ex(&ce, NULL); - class_entry->ce_flags |= ZEND_ACC_FINAL|ZEND_ACC_NO_DYNAMIC_PROPERTIES; + class_entry->ce_flags |= ZEND_ACC_FINAL|ZEND_ACC_NO_DYNAMIC_PROPERTIES|ZEND_ACC_NOT_SERIALIZABLE; return class_entry; } diff --git a/ext/imap/php_imap.c b/ext/imap/php_imap.c index 37d4681d484..3d28235e318 100644 --- a/ext/imap/php_imap.c +++ b/ext/imap/php_imap.c @@ -35,7 +35,6 @@ #include "php_ini.h" #include "php_streams.h" #include "Zend/zend_exceptions.h" -#include "Zend/zend_interfaces.h" #include "ext/standard/php_string.h" #include "ext/standard/info.h" #include "ext/standard/file.h" @@ -481,8 +480,6 @@ PHP_MINIT_FUNCTION(imap) php_imap_ce = register_class_IMAP_Connection(); php_imap_ce->create_object = imap_object_create; - php_imap_ce->serialize = zend_class_serialize_deny; - php_imap_ce->unserialize = zend_class_unserialize_deny; memcpy(&imap_object_handlers, &std_object_handlers, sizeof(zend_object_handlers)); imap_object_handlers.offset = XtOffsetOf(php_imap_object, std); diff --git a/ext/imap/php_imap.stub.php b/ext/imap/php_imap.stub.php index 92e583bad15..c3d8b332213 100644 --- a/ext/imap/php_imap.stub.php +++ b/ext/imap/php_imap.stub.php @@ -4,7 +4,10 @@ namespace IMAP { - /** @strict-properties */ + /** + * @strict-properties + * @not-serializable + */ final class Connection { } diff --git a/ext/imap/php_imap_arginfo.h b/ext/imap/php_imap_arginfo.h index e84d8516db3..ea8607c6d7b 100644 --- a/ext/imap/php_imap_arginfo.h +++ b/ext/imap/php_imap_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 6bddb8501bf577d1bc6d81c5a97f90c250bbeee6 */ + * Stub hash: 706de8c7fbb821b71ad8cfdbbab38fe30fa6590a */ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_imap_open, 0, 3, IMAP\\Connection, MAY_BE_FALSE) ZEND_ARG_TYPE_INFO(0, mailbox, IS_STRING, 0) @@ -524,7 +524,7 @@ static zend_class_entry *register_class_IMAP_Connection(void) INIT_NS_CLASS_ENTRY(ce, "IMAP", "Connection", class_IMAP_Connection_methods); class_entry = zend_register_internal_class_ex(&ce, NULL); - class_entry->ce_flags |= ZEND_ACC_FINAL|ZEND_ACC_NO_DYNAMIC_PROPERTIES; + class_entry->ce_flags |= ZEND_ACC_FINAL|ZEND_ACC_NO_DYNAMIC_PROPERTIES|ZEND_ACC_NOT_SERIALIZABLE; return class_entry; } diff --git a/ext/intl/formatter/formatter.stub.php b/ext/intl/formatter/formatter.stub.php index 4177778e74d..68423e1d94b 100644 --- a/ext/intl/formatter/formatter.stub.php +++ b/ext/intl/formatter/formatter.stub.php @@ -2,6 +2,9 @@ /** @generate-class-entries */ +/** + * @not-serializable + */ class NumberFormatter { public function __construct(string $locale, int $style, ?string $pattern = null) {} diff --git a/ext/intl/formatter/formatter_arginfo.h b/ext/intl/formatter/formatter_arginfo.h index 6aa76da370a..1f7647c4b11 100644 --- a/ext/intl/formatter/formatter_arginfo.h +++ b/ext/intl/formatter/formatter_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 2e206724ce3c387109b39bcac20af1c35ea7fba2 */ + * Stub hash: 3cc95768092e2c6ddfcab9379d1963b58ab94def */ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_NumberFormatter___construct, 0, 0, 2) ZEND_ARG_TYPE_INFO(0, locale, IS_STRING, 0) @@ -126,6 +126,7 @@ static zend_class_entry *register_class_NumberFormatter(void) INIT_CLASS_ENTRY(ce, "NumberFormatter", class_NumberFormatter_methods); class_entry = zend_register_internal_class_ex(&ce, NULL); + class_entry->ce_flags |= ZEND_ACC_NOT_SERIALIZABLE; return class_entry; } diff --git a/ext/intl/formatter/formatter_class.c b/ext/intl/formatter/formatter_class.c index 5241060a9fb..ce71f43a816 100644 --- a/ext/intl/formatter/formatter_class.c +++ b/ext/intl/formatter/formatter_class.c @@ -99,8 +99,6 @@ void formatter_register_class( void ) /* Create and register 'NumberFormatter' class. */ NumberFormatter_ce_ptr = register_class_NumberFormatter(); NumberFormatter_ce_ptr->create_object = NumberFormatter_object_create; - NumberFormatter_ce_ptr->serialize = zend_class_serialize_deny; - NumberFormatter_ce_ptr->unserialize = zend_class_unserialize_deny; memcpy(&NumberFormatter_handlers, &std_object_handlers, sizeof(NumberFormatter_handlers)); diff --git a/ext/ldap/ldap.c b/ext/ldap/ldap.c index 13a3c7b6b8f..ce0afa31daf 100644 --- a/ext/ldap/ldap.c +++ b/ext/ldap/ldap.c @@ -34,7 +34,6 @@ #include "ext/standard/dl.h" #include "php_ldap.h" #include "ldap_arginfo.h" -#include "Zend/zend_interfaces.h" #ifdef PHP_WIN32 #include @@ -828,8 +827,6 @@ PHP_MINIT_FUNCTION(ldap) ldap_link_ce = register_class_LDAP_Connection(); ldap_link_ce->create_object = ldap_link_create_object; - ldap_link_ce->serialize = zend_class_serialize_deny; - ldap_link_ce->unserialize = zend_class_unserialize_deny; memcpy(&ldap_link_object_handlers, &std_object_handlers, sizeof(zend_object_handlers)); ldap_link_object_handlers.offset = XtOffsetOf(ldap_linkdata, std); @@ -840,8 +837,6 @@ PHP_MINIT_FUNCTION(ldap) ldap_result_ce = register_class_LDAP_Result(); ldap_result_ce->create_object = ldap_result_create_object; - ldap_result_ce->serialize = zend_class_serialize_deny; - ldap_result_ce->unserialize = zend_class_unserialize_deny; memcpy(&ldap_result_object_handlers, &std_object_handlers, sizeof(zend_object_handlers)); ldap_result_object_handlers.offset = XtOffsetOf(ldap_resultdata, std); @@ -852,8 +847,6 @@ PHP_MINIT_FUNCTION(ldap) ldap_result_entry_ce = register_class_LDAP_ResultEntry(); ldap_result_entry_ce->create_object = ldap_result_entry_create_object; - ldap_result_entry_ce->serialize = zend_class_serialize_deny; - ldap_result_entry_ce->unserialize = zend_class_unserialize_deny; memcpy(&ldap_result_entry_object_handlers, &std_object_handlers, sizeof(zend_object_handlers)); ldap_result_entry_object_handlers.offset = XtOffsetOf(ldap_result_entry, std); diff --git a/ext/ldap/ldap.stub.php b/ext/ldap/ldap.stub.php index ddebe71e79f..2aeba0ce21b 100644 --- a/ext/ldap/ldap.stub.php +++ b/ext/ldap/ldap.stub.php @@ -4,17 +4,26 @@ namespace LDAP { - /** @strict-properties */ + /** + * @strict-properties + * @not-serializable + */ final class Connection { } - /** @strict-properties */ + /** + * @strict-properties + * @not-serializable + */ final class Result { } - /** @strict-properties */ + /** + * @strict-properties + * @not-serializable + */ final class ResultEntry { } diff --git a/ext/ldap/ldap_arginfo.h b/ext/ldap/ldap_arginfo.h index b15cfc34ca3..c5eb6335854 100644 --- a/ext/ldap/ldap_arginfo.h +++ b/ext/ldap/ldap_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 4eb9f7e0932abf782a4ca17f8186d21ea33341cb */ + * Stub hash: 482ee2b3df6b6f6b9e86e0af890c441d6222356d */ #if defined(HAVE_ORALDAP) ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_ldap_connect, 0, 0, LDAP\\Connection, MAY_BE_FALSE) @@ -565,7 +565,7 @@ static zend_class_entry *register_class_LDAP_Connection(void) INIT_NS_CLASS_ENTRY(ce, "LDAP", "Connection", class_LDAP_Connection_methods); class_entry = zend_register_internal_class_ex(&ce, NULL); - class_entry->ce_flags |= ZEND_ACC_FINAL|ZEND_ACC_NO_DYNAMIC_PROPERTIES; + class_entry->ce_flags |= ZEND_ACC_FINAL|ZEND_ACC_NO_DYNAMIC_PROPERTIES|ZEND_ACC_NOT_SERIALIZABLE; return class_entry; } @@ -576,7 +576,7 @@ static zend_class_entry *register_class_LDAP_Result(void) INIT_NS_CLASS_ENTRY(ce, "LDAP", "Result", class_LDAP_Result_methods); class_entry = zend_register_internal_class_ex(&ce, NULL); - class_entry->ce_flags |= ZEND_ACC_FINAL|ZEND_ACC_NO_DYNAMIC_PROPERTIES; + class_entry->ce_flags |= ZEND_ACC_FINAL|ZEND_ACC_NO_DYNAMIC_PROPERTIES|ZEND_ACC_NOT_SERIALIZABLE; return class_entry; } @@ -587,7 +587,7 @@ static zend_class_entry *register_class_LDAP_ResultEntry(void) INIT_NS_CLASS_ENTRY(ce, "LDAP", "ResultEntry", class_LDAP_ResultEntry_methods); class_entry = zend_register_internal_class_ex(&ce, NULL); - class_entry->ce_flags |= ZEND_ACC_FINAL|ZEND_ACC_NO_DYNAMIC_PROPERTIES; + class_entry->ce_flags |= ZEND_ACC_FINAL|ZEND_ACC_NO_DYNAMIC_PROPERTIES|ZEND_ACC_NOT_SERIALIZABLE; return class_entry; } diff --git a/ext/opcache/zend_file_cache.c b/ext/opcache/zend_file_cache.c index 65a2206d299..94641fd544b 100644 --- a/ext/opcache/zend_file_cache.c +++ b/ext/opcache/zend_file_cache.c @@ -1640,11 +1640,6 @@ static void zend_file_cache_unserialize_class(zval *zv, UNSERIALIZE_PTR(ce->__callstatic); UNSERIALIZE_PTR(ce->__debugInfo); - if (UNEXPECTED((ce->ce_flags & ZEND_ACC_ANON_CLASS))) { - ce->serialize = zend_class_serialize_deny; - ce->unserialize = zend_class_unserialize_deny; - } - if (ce->iterator_funcs_ptr) { UNSERIALIZE_PTR(ce->iterator_funcs_ptr); UNSERIALIZE_PTR(ce->iterator_funcs_ptr->zf_new_iterator); diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c index ecab79ef920..9f5018d2fd7 100644 --- a/ext/openssl/openssl.c +++ b/ext/openssl/openssl.c @@ -28,7 +28,6 @@ #include "php_ini.h" #include "php_openssl.h" #include "zend_exceptions.h" -#include "Zend/zend_interfaces.h" /* PHP Includes */ #include "ext/standard/file.h" @@ -1105,8 +1104,6 @@ PHP_MINIT_FUNCTION(openssl) php_openssl_certificate_ce = register_class_OpenSSLCertificate(); php_openssl_certificate_ce->create_object = php_openssl_certificate_create_object; - php_openssl_certificate_ce->serialize = zend_class_serialize_deny; - php_openssl_certificate_ce->unserialize = zend_class_unserialize_deny; memcpy(&php_openssl_certificate_object_handlers, &std_object_handlers, sizeof(zend_object_handlers)); php_openssl_certificate_object_handlers.offset = XtOffsetOf(php_openssl_certificate_object, std); @@ -1117,8 +1114,6 @@ PHP_MINIT_FUNCTION(openssl) php_openssl_request_ce = register_class_OpenSSLCertificateSigningRequest(); php_openssl_request_ce->create_object = php_openssl_request_create_object; - php_openssl_request_ce->serialize = zend_class_serialize_deny; - php_openssl_request_ce->unserialize = zend_class_unserialize_deny; memcpy(&php_openssl_request_object_handlers, &std_object_handlers, sizeof(zend_object_handlers)); php_openssl_request_object_handlers.offset = XtOffsetOf(php_openssl_request_object, std); @@ -1129,8 +1124,6 @@ PHP_MINIT_FUNCTION(openssl) php_openssl_pkey_ce = register_class_OpenSSLAsymmetricKey(); php_openssl_pkey_ce->create_object = php_openssl_pkey_create_object; - php_openssl_pkey_ce->serialize = zend_class_serialize_deny; - php_openssl_pkey_ce->unserialize = zend_class_unserialize_deny; memcpy(&php_openssl_pkey_object_handlers, &std_object_handlers, sizeof(zend_object_handlers)); php_openssl_pkey_object_handlers.offset = XtOffsetOf(php_openssl_pkey_object, std); diff --git a/ext/openssl/openssl.stub.php b/ext/openssl/openssl.stub.php index eafd5d29345..f9395274fd6 100644 --- a/ext/openssl/openssl.stub.php +++ b/ext/openssl/openssl.stub.php @@ -2,17 +2,26 @@ /** @generate-class-entries */ -/** @strict-properties */ +/** + * @strict-properties + * @not-serializable + */ final class OpenSSLCertificate { } -/** @strict-properties */ +/** + * @strict-properties + * @not-serializable + */ final class OpenSSLCertificateSigningRequest { } -/** @strict-properties */ +/** + * @strict-properties + * @not-serializable + */ final class OpenSSLAsymmetricKey { } diff --git a/ext/openssl/openssl_arginfo.h b/ext/openssl/openssl_arginfo.h index 43fc6d23cb6..5c216a3424a 100644 --- a/ext/openssl/openssl_arginfo.h +++ b/ext/openssl/openssl_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: a4b535ad55e15d61baa83f697071fc77f7e9c4e0 */ + * Stub hash: 1eac784acca52fab0a38852b18503b072f780ff4 */ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_openssl_x509_export_to_file, 0, 2, _IS_BOOL, 0) ZEND_ARG_OBJ_TYPE_MASK(0, certificate, OpenSSLCertificate, MAY_BE_STRING, NULL) @@ -540,7 +540,7 @@ static zend_class_entry *register_class_OpenSSLCertificate(void) INIT_CLASS_ENTRY(ce, "OpenSSLCertificate", class_OpenSSLCertificate_methods); class_entry = zend_register_internal_class_ex(&ce, NULL); - class_entry->ce_flags |= ZEND_ACC_FINAL|ZEND_ACC_NO_DYNAMIC_PROPERTIES; + class_entry->ce_flags |= ZEND_ACC_FINAL|ZEND_ACC_NO_DYNAMIC_PROPERTIES|ZEND_ACC_NOT_SERIALIZABLE; return class_entry; } @@ -551,7 +551,7 @@ static zend_class_entry *register_class_OpenSSLCertificateSigningRequest(void) INIT_CLASS_ENTRY(ce, "OpenSSLCertificateSigningRequest", class_OpenSSLCertificateSigningRequest_methods); class_entry = zend_register_internal_class_ex(&ce, NULL); - class_entry->ce_flags |= ZEND_ACC_FINAL|ZEND_ACC_NO_DYNAMIC_PROPERTIES; + class_entry->ce_flags |= ZEND_ACC_FINAL|ZEND_ACC_NO_DYNAMIC_PROPERTIES|ZEND_ACC_NOT_SERIALIZABLE; return class_entry; } @@ -562,7 +562,7 @@ static zend_class_entry *register_class_OpenSSLAsymmetricKey(void) INIT_CLASS_ENTRY(ce, "OpenSSLAsymmetricKey", class_OpenSSLAsymmetricKey_methods); class_entry = zend_register_internal_class_ex(&ce, NULL); - class_entry->ce_flags |= ZEND_ACC_FINAL|ZEND_ACC_NO_DYNAMIC_PROPERTIES; + class_entry->ce_flags |= ZEND_ACC_FINAL|ZEND_ACC_NO_DYNAMIC_PROPERTIES|ZEND_ACC_NOT_SERIALIZABLE; return class_entry; } diff --git a/ext/pdo/pdo_dbh.c b/ext/pdo/pdo_dbh.c index 48632c82d5b..d53d2ca63c0 100644 --- a/ext/pdo/pdo_dbh.c +++ b/ext/pdo/pdo_dbh.c @@ -31,7 +31,6 @@ #include "zend_exceptions.h" #include "zend_object_handlers.h" #include "zend_hash.h" -#include "zend_interfaces.h" #include "pdo_dbh_arginfo.h" static bool pdo_dbh_attribute_set(pdo_dbh_t *dbh, zend_long attr, zval *value); @@ -1326,8 +1325,6 @@ void pdo_dbh_init(void) { pdo_dbh_ce = register_class_PDO(); pdo_dbh_ce->create_object = pdo_dbh_new; - pdo_dbh_ce->serialize = zend_class_serialize_deny; - pdo_dbh_ce->unserialize = zend_class_unserialize_deny; memcpy(&pdo_dbh_object_handlers, &std_object_handlers, sizeof(zend_object_handlers)); pdo_dbh_object_handlers.offset = XtOffsetOf(pdo_dbh_object_t, std); diff --git a/ext/pdo/pdo_dbh.stub.php b/ext/pdo/pdo_dbh.stub.php index 9d37ad5497f..f91ed6c2182 100644 --- a/ext/pdo/pdo_dbh.stub.php +++ b/ext/pdo/pdo_dbh.stub.php @@ -2,6 +2,9 @@ /** @generate-class-entries */ +/** + * @not-serializable + */ class PDO { public function __construct(string $dsn, ?string $username = null, ?string $password = null, ?array $options = null) {} diff --git a/ext/pdo/pdo_dbh_arginfo.h b/ext/pdo/pdo_dbh_arginfo.h index b9916847d96..9629b70deb6 100644 --- a/ext/pdo/pdo_dbh_arginfo.h +++ b/ext/pdo/pdo_dbh_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: c0f18da92bca9f57b18e58fbc96e47b4195519a2 */ + * Stub hash: 427f534213227208cd0b02c936d526ea08fa008f */ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PDO___construct, 0, 0, 1) ZEND_ARG_TYPE_INFO(0, dsn, IS_STRING, 0) @@ -101,6 +101,7 @@ static zend_class_entry *register_class_PDO(void) INIT_CLASS_ENTRY(ce, "PDO", class_PDO_methods); class_entry = zend_register_internal_class_ex(&ce, NULL); + class_entry->ce_flags |= ZEND_ACC_NOT_SERIALIZABLE; return class_entry; } diff --git a/ext/pdo/pdo_stmt.c b/ext/pdo/pdo_stmt.c index 52c9dad9969..32d985dc379 100644 --- a/ext/pdo/pdo_stmt.c +++ b/ext/pdo/pdo_stmt.c @@ -2496,8 +2496,6 @@ void pdo_stmt_init(void) pdo_dbstmt_ce = register_class_PDOStatement(zend_ce_aggregate); pdo_dbstmt_ce->get_iterator = pdo_stmt_iter_get; pdo_dbstmt_ce->create_object = pdo_dbstmt_new; - pdo_dbstmt_ce->serialize = zend_class_serialize_deny; - pdo_dbstmt_ce->unserialize = zend_class_unserialize_deny; memcpy(&pdo_dbstmt_object_handlers, &std_object_handlers, sizeof(zend_object_handlers)); pdo_dbstmt_object_handlers.offset = XtOffsetOf(pdo_stmt_t, std); @@ -2510,8 +2508,6 @@ void pdo_stmt_init(void) pdo_row_ce = register_class_PDORow(); pdo_row_ce->create_object = pdo_row_new; - pdo_row_ce->serialize = zend_class_serialize_deny; - pdo_row_ce->unserialize = zend_class_unserialize_deny; memcpy(&pdo_row_object_handlers, &std_object_handlers, sizeof(zend_object_handlers)); pdo_row_object_handlers.free_obj = pdo_row_free_storage; diff --git a/ext/pdo/pdo_stmt.stub.php b/ext/pdo/pdo_stmt.stub.php index cf350999c6f..c008b4e4127 100644 --- a/ext/pdo/pdo_stmt.stub.php +++ b/ext/pdo/pdo_stmt.stub.php @@ -2,6 +2,9 @@ /** @generate-class-entries */ +/** + * @not-serializable + */ class PDOStatement implements IteratorAggregate { public string $queryString; @@ -66,6 +69,9 @@ class PDOStatement implements IteratorAggregate public function getIterator(): Iterator {} } +/** + * @not-serializable + */ final class PDORow { public string $queryString; diff --git a/ext/pdo/pdo_stmt_arginfo.h b/ext/pdo/pdo_stmt_arginfo.h index ef11d4c396b..716a75337b1 100644 --- a/ext/pdo/pdo_stmt_arginfo.h +++ b/ext/pdo/pdo_stmt_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 670126c620221ba392f4cd41cdb31877cc29e1e3 */ + * Stub hash: f5f2932888bcbffa771092e9a54508d4c51c32ab */ ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_PDOStatement_bindColumn, 0, 2, _IS_BOOL, 0) ZEND_ARG_TYPE_MASK(0, column, MAY_BE_STRING|MAY_BE_LONG, NULL) @@ -145,6 +145,7 @@ static zend_class_entry *register_class_PDOStatement(zend_class_entry *class_ent INIT_CLASS_ENTRY(ce, "PDOStatement", class_PDOStatement_methods); class_entry = zend_register_internal_class_ex(&ce, NULL); + class_entry->ce_flags |= ZEND_ACC_NOT_SERIALIZABLE; zend_class_implements(class_entry, 1, class_entry_IteratorAggregate); zval property_queryString_default_value; @@ -162,7 +163,7 @@ static zend_class_entry *register_class_PDORow(void) INIT_CLASS_ENTRY(ce, "PDORow", class_PDORow_methods); class_entry = zend_register_internal_class_ex(&ce, NULL); - class_entry->ce_flags |= ZEND_ACC_FINAL; + class_entry->ce_flags |= ZEND_ACC_FINAL|ZEND_ACC_NOT_SERIALIZABLE; zval property_queryString_default_value; ZVAL_UNDEF(&property_queryString_default_value); diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c index 683973674f6..e24204fdfa7 100644 --- a/ext/pgsql/pgsql.c +++ b/ext/pgsql/pgsql.c @@ -39,7 +39,6 @@ #include "php_pgsql.h" #include "php_globals.h" #include "zend_exceptions.h" -#include "Zend/zend_interfaces.h" #include "pgsql_arginfo.h" #ifdef HAVE_PGSQL @@ -440,8 +439,6 @@ PHP_MINIT_FUNCTION(pgsql) pgsql_link_ce = register_class_PgSql_Connection(); pgsql_link_ce->create_object = pgsql_link_create_object; - pgsql_link_ce->serialize = zend_class_serialize_deny; - pgsql_link_ce->unserialize = zend_class_unserialize_deny; memcpy(&pgsql_link_object_handlers, &std_object_handlers, sizeof(zend_object_handlers)); pgsql_link_object_handlers.offset = XtOffsetOf(pgsql_link_handle, std); @@ -452,8 +449,6 @@ PHP_MINIT_FUNCTION(pgsql) pgsql_result_ce = register_class_PgSql_Result(); pgsql_result_ce->create_object = pgsql_result_create_object; - pgsql_result_ce->serialize = zend_class_serialize_deny; - pgsql_result_ce->unserialize = zend_class_unserialize_deny; memcpy(&pgsql_result_object_handlers, &std_object_handlers, sizeof(zend_object_handlers)); pgsql_result_object_handlers.offset = XtOffsetOf(pgsql_result_handle, std); @@ -464,8 +459,6 @@ PHP_MINIT_FUNCTION(pgsql) pgsql_lob_ce = register_class_PgSql_Lob(); pgsql_lob_ce->create_object = pgsql_lob_create_object; - pgsql_lob_ce->serialize = zend_class_serialize_deny; - pgsql_lob_ce->unserialize = zend_class_unserialize_deny; memcpy(&pgsql_lob_object_handlers, &std_object_handlers, sizeof(zend_object_handlers)); pgsql_lob_object_handlers.offset = XtOffsetOf(pgLofp, std); diff --git a/ext/pgsql/pgsql.stub.php b/ext/pgsql/pgsql.stub.php index 53750a4c349..aacfca81382 100644 --- a/ext/pgsql/pgsql.stub.php +++ b/ext/pgsql/pgsql.stub.php @@ -4,17 +4,26 @@ namespace PgSql { - /** @strict-properties */ + /** + * @strict-properties + * @not-serializable + */ final class Connection { } - /** @strict-properties */ + /** + * @strict-properties + * @not-serializable + */ final class Result { } - /** @strict-properties */ + /** + * @strict-properties + * @not-serializable + */ final class Lob { } diff --git a/ext/pgsql/pgsql_arginfo.h b/ext/pgsql/pgsql_arginfo.h index 2f7b4612faf..3cf6eb570ba 100644 --- a/ext/pgsql/pgsql_arginfo.h +++ b/ext/pgsql/pgsql_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: f3a22bb5694dade9b7e84d559d05abe26319f3fa */ + * Stub hash: 39b3a34ba955184bbfcc7a792fa0ecc2877ac064 */ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_pg_connect, 0, 1, PgSql\\Connection, MAY_BE_FALSE) ZEND_ARG_TYPE_INFO(0, connection_string, IS_STRING, 0) @@ -676,7 +676,7 @@ static zend_class_entry *register_class_PgSql_Connection(void) INIT_NS_CLASS_ENTRY(ce, "PgSql", "Connection", class_PgSql_Connection_methods); class_entry = zend_register_internal_class_ex(&ce, NULL); - class_entry->ce_flags |= ZEND_ACC_FINAL|ZEND_ACC_NO_DYNAMIC_PROPERTIES; + class_entry->ce_flags |= ZEND_ACC_FINAL|ZEND_ACC_NO_DYNAMIC_PROPERTIES|ZEND_ACC_NOT_SERIALIZABLE; return class_entry; } @@ -687,7 +687,7 @@ static zend_class_entry *register_class_PgSql_Result(void) INIT_NS_CLASS_ENTRY(ce, "PgSql", "Result", class_PgSql_Result_methods); class_entry = zend_register_internal_class_ex(&ce, NULL); - class_entry->ce_flags |= ZEND_ACC_FINAL|ZEND_ACC_NO_DYNAMIC_PROPERTIES; + class_entry->ce_flags |= ZEND_ACC_FINAL|ZEND_ACC_NO_DYNAMIC_PROPERTIES|ZEND_ACC_NOT_SERIALIZABLE; return class_entry; } @@ -698,7 +698,7 @@ static zend_class_entry *register_class_PgSql_Lob(void) INIT_NS_CLASS_ENTRY(ce, "PgSql", "Lob", class_PgSql_Lob_methods); class_entry = zend_register_internal_class_ex(&ce, NULL); - class_entry->ce_flags |= ZEND_ACC_FINAL|ZEND_ACC_NO_DYNAMIC_PROPERTIES; + class_entry->ce_flags |= ZEND_ACC_FINAL|ZEND_ACC_NO_DYNAMIC_PROPERTIES|ZEND_ACC_NOT_SERIALIZABLE; return class_entry; } diff --git a/ext/pspell/pspell.c b/ext/pspell/pspell.c index 6cb327635be..58960e9df56 100644 --- a/ext/pspell/pspell.c +++ b/ext/pspell/pspell.c @@ -19,7 +19,6 @@ #endif #include "php.h" -#include "zend_interfaces.h" #include #include @@ -152,8 +151,6 @@ static PHP_MINIT_FUNCTION(pspell) { php_pspell_ce = register_class_PSpell_Dictionary(); php_pspell_ce->create_object = php_pspell_object_create; - php_pspell_ce->serialize = zend_class_serialize_deny; - php_pspell_ce->unserialize = zend_class_unserialize_deny; memcpy(&php_pspell_handlers, &std_object_handlers, sizeof(zend_object_handlers)); php_pspell_handlers.clone_obj = NULL; @@ -163,8 +160,6 @@ static PHP_MINIT_FUNCTION(pspell) php_pspell_config_ce = register_class_PSpell_Config(); php_pspell_config_ce->create_object = php_pspell_config_object_create; - php_pspell_config_ce->serialize = zend_class_serialize_deny; - php_pspell_config_ce->unserialize = zend_class_unserialize_deny; memcpy(&php_pspell_config_handlers, &std_object_handlers, sizeof(zend_object_handlers)); php_pspell_config_handlers.clone_obj = NULL; diff --git a/ext/pspell/pspell.stub.php b/ext/pspell/pspell.stub.php index 30f2ee8c267..3f0eb8a20eb 100644 --- a/ext/pspell/pspell.stub.php +++ b/ext/pspell/pspell.stub.php @@ -4,10 +4,16 @@ namespace PSpell { - /** @strict-properties */ + /** + * @strict-properties + * @not-serializable + */ final class Dictionary {} - /** @strict-properties */ + /** + * @strict-properties + * @not-serializable + */ final class Config {} } diff --git a/ext/pspell/pspell_arginfo.h b/ext/pspell/pspell_arginfo.h index 4b9bfe74ef2..190977d401c 100644 --- a/ext/pspell/pspell_arginfo.h +++ b/ext/pspell/pspell_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 2b0ad8955ed24d708f7785e3542c6a727aa3e1ea */ + * Stub hash: 04660f3f9559eed67a224d219d38ff80d131b118 */ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_pspell_new, 0, 1, PSpell\\Dictionary, MAY_BE_FALSE) ZEND_ARG_TYPE_INFO(0, language, IS_STRING, 0) @@ -150,7 +150,7 @@ static zend_class_entry *register_class_PSpell_Dictionary(void) INIT_NS_CLASS_ENTRY(ce, "PSpell", "Dictionary", class_PSpell_Dictionary_methods); class_entry = zend_register_internal_class_ex(&ce, NULL); - class_entry->ce_flags |= ZEND_ACC_FINAL|ZEND_ACC_NO_DYNAMIC_PROPERTIES; + class_entry->ce_flags |= ZEND_ACC_FINAL|ZEND_ACC_NO_DYNAMIC_PROPERTIES|ZEND_ACC_NOT_SERIALIZABLE; return class_entry; } @@ -161,7 +161,7 @@ static zend_class_entry *register_class_PSpell_Config(void) INIT_NS_CLASS_ENTRY(ce, "PSpell", "Config", class_PSpell_Config_methods); class_entry = zend_register_internal_class_ex(&ce, NULL); - class_entry->ce_flags |= ZEND_ACC_FINAL|ZEND_ACC_NO_DYNAMIC_PROPERTIES; + class_entry->ce_flags |= ZEND_ACC_FINAL|ZEND_ACC_NO_DYNAMIC_PROPERTIES|ZEND_ACC_NOT_SERIALIZABLE; return class_entry; } diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index 42b9356bf21..5a10dcdb046 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -7036,12 +7036,6 @@ static zval *_reflection_write_property(zend_object *object, zend_string *name, } /* }}} */ -static void reflection_init_class_handlers(zend_class_entry *ce) { - ce->create_object = reflection_objects_new; - ce->serialize = zend_class_serialize_deny; - ce->unserialize = zend_class_unserialize_deny; -} - PHP_MINIT_FUNCTION(reflection) /* {{{ */ { memcpy(&reflection_object_handlers, &std_object_handlers, sizeof(zend_object_handlers)); @@ -7058,33 +7052,33 @@ PHP_MINIT_FUNCTION(reflection) /* {{{ */ reflector_ptr = register_class_Reflector(zend_ce_stringable); reflection_function_abstract_ptr = register_class_ReflectionFunctionAbstract(reflector_ptr); - reflection_init_class_handlers(reflection_function_abstract_ptr); + reflection_function_abstract_ptr->create_object = reflection_objects_new; reflection_function_ptr = register_class_ReflectionFunction(reflection_function_abstract_ptr); - reflection_init_class_handlers(reflection_function_ptr); + reflection_function_ptr->create_object = reflection_objects_new; REGISTER_REFLECTION_CLASS_CONST_LONG(function, "IS_DEPRECATED", ZEND_ACC_DEPRECATED); reflection_generator_ptr = register_class_ReflectionGenerator(); - reflection_init_class_handlers(reflection_generator_ptr); + reflection_generator_ptr->create_object = reflection_objects_new; reflection_parameter_ptr = register_class_ReflectionParameter(reflector_ptr); - reflection_init_class_handlers(reflection_parameter_ptr); + reflection_parameter_ptr->create_object = reflection_objects_new; reflection_type_ptr = register_class_ReflectionType(zend_ce_stringable); - reflection_init_class_handlers(reflection_type_ptr); + reflection_type_ptr->create_object = reflection_objects_new; reflection_named_type_ptr = register_class_ReflectionNamedType(reflection_type_ptr); - reflection_init_class_handlers(reflection_named_type_ptr); + reflection_named_type_ptr->create_object = reflection_objects_new; reflection_union_type_ptr = register_class_ReflectionUnionType(reflection_type_ptr); - reflection_init_class_handlers(reflection_union_type_ptr); + reflection_union_type_ptr->create_object = reflection_objects_new; reflection_intersection_type_ptr = register_class_ReflectionIntersectionType(reflection_type_ptr); - reflection_init_class_handlers(reflection_intersection_type_ptr); + reflection_intersection_type_ptr->create_object = reflection_objects_new; reflection_method_ptr = register_class_ReflectionMethod(reflection_function_abstract_ptr); - reflection_init_class_handlers(reflection_method_ptr); + reflection_method_ptr->create_object = reflection_objects_new; REGISTER_REFLECTION_CLASS_CONST_LONG(method, "IS_STATIC", ZEND_ACC_STATIC); REGISTER_REFLECTION_CLASS_CONST_LONG(method, "IS_PUBLIC", ZEND_ACC_PUBLIC); @@ -7094,7 +7088,7 @@ PHP_MINIT_FUNCTION(reflection) /* {{{ */ REGISTER_REFLECTION_CLASS_CONST_LONG(method, "IS_FINAL", ZEND_ACC_FINAL); reflection_class_ptr = register_class_ReflectionClass(reflector_ptr); - reflection_init_class_handlers(reflection_class_ptr); + reflection_class_ptr->create_object = reflection_objects_new; /* IS_IMPLICIT_ABSTRACT is not longer used */ REGISTER_REFLECTION_CLASS_CONST_LONG(class, "IS_IMPLICIT_ABSTRACT", ZEND_ACC_IMPLICIT_ABSTRACT_CLASS); @@ -7102,10 +7096,10 @@ PHP_MINIT_FUNCTION(reflection) /* {{{ */ REGISTER_REFLECTION_CLASS_CONST_LONG(class, "IS_FINAL", ZEND_ACC_FINAL); reflection_object_ptr = register_class_ReflectionObject(reflection_class_ptr); - reflection_init_class_handlers(reflection_object_ptr); + reflection_object_ptr->create_object = reflection_objects_new; reflection_property_ptr = register_class_ReflectionProperty(reflector_ptr); - reflection_init_class_handlers(reflection_property_ptr); + reflection_property_ptr->create_object = reflection_objects_new; REGISTER_REFLECTION_CLASS_CONST_LONG(property, "IS_STATIC", ZEND_ACC_STATIC); REGISTER_REFLECTION_CLASS_CONST_LONG(property, "IS_PUBLIC", ZEND_ACC_PUBLIC); @@ -7113,7 +7107,7 @@ PHP_MINIT_FUNCTION(reflection) /* {{{ */ REGISTER_REFLECTION_CLASS_CONST_LONG(property, "IS_PRIVATE", ZEND_ACC_PRIVATE); reflection_class_constant_ptr = register_class_ReflectionClassConstant(reflector_ptr); - reflection_init_class_handlers(reflection_class_constant_ptr); + reflection_class_constant_ptr->create_object = reflection_objects_new; REGISTER_REFLECTION_CLASS_CONST_LONG(class_constant, "IS_PUBLIC", ZEND_ACC_PUBLIC); REGISTER_REFLECTION_CLASS_CONST_LONG(class_constant, "IS_PROTECTED", ZEND_ACC_PROTECTED); @@ -7121,28 +7115,28 @@ PHP_MINIT_FUNCTION(reflection) /* {{{ */ REGISTER_REFLECTION_CLASS_CONST_LONG(class_constant, "IS_FINAL", ZEND_ACC_FINAL); reflection_extension_ptr = register_class_ReflectionExtension(reflector_ptr); - reflection_init_class_handlers(reflection_extension_ptr); + reflection_extension_ptr->create_object = reflection_objects_new; reflection_zend_extension_ptr = register_class_ReflectionZendExtension(reflector_ptr); - reflection_init_class_handlers(reflection_zend_extension_ptr); + reflection_zend_extension_ptr->create_object = reflection_objects_new; reflection_reference_ptr = register_class_ReflectionReference(); - reflection_init_class_handlers(reflection_reference_ptr); + reflection_reference_ptr->create_object = reflection_objects_new; reflection_attribute_ptr = register_class_ReflectionAttribute(reflector_ptr); - reflection_init_class_handlers(reflection_attribute_ptr); + reflection_attribute_ptr->create_object = reflection_objects_new; reflection_enum_ptr = register_class_ReflectionEnum(reflection_class_ptr); - reflection_init_class_handlers(reflection_enum_ptr); + reflection_enum_ptr->create_object = reflection_objects_new; reflection_enum_unit_case_ptr = register_class_ReflectionEnumUnitCase(reflection_class_constant_ptr); - reflection_init_class_handlers(reflection_enum_unit_case_ptr); + reflection_enum_unit_case_ptr->create_object = reflection_objects_new; reflection_enum_backed_case_ptr = register_class_ReflectionEnumBackedCase(reflection_enum_unit_case_ptr); - reflection_init_class_handlers(reflection_enum_backed_case_ptr); + reflection_enum_backed_case_ptr->create_object = reflection_objects_new; reflection_fiber_ptr = register_class_ReflectionFiber(); - reflection_init_class_handlers(reflection_fiber_ptr); + reflection_fiber_ptr->create_object = reflection_objects_new; REGISTER_REFLECTION_CLASS_CONST_LONG(attribute, "IS_INSTANCEOF", REFLECTION_ATTRIBUTE_IS_INSTANCEOF); diff --git a/ext/reflection/php_reflection.stub.php b/ext/reflection/php_reflection.stub.php index 2b75372f0c8..af716889e0c 100644 --- a/ext/reflection/php_reflection.stub.php +++ b/ext/reflection/php_reflection.stub.php @@ -16,6 +16,9 @@ interface Reflector extends Stringable { } +/** + * @not-serializable + */ abstract class ReflectionFunctionAbstract implements Reflector { public string $name; @@ -132,6 +135,9 @@ class ReflectionFunction extends ReflectionFunctionAbstract public function getClosure(): Closure {} } +/** + * @not-serializable + */ final class ReflectionGenerator { public function __construct(Generator $generator) {} @@ -206,6 +212,9 @@ class ReflectionMethod extends ReflectionFunctionAbstract public function setAccessible(bool $accessible): void {} } +/** + * @not-serializable + */ class ReflectionClass implements Reflector { public string $name; @@ -380,6 +389,9 @@ class ReflectionObject extends ReflectionClass public function __construct(object $object) {} } +/** + * @not-serializable + */ class ReflectionProperty implements Reflector { public string $name; @@ -448,6 +460,9 @@ class ReflectionProperty implements Reflector public function getAttributes(?string $name = null, int $flags = 0): array {} } +/** + * @not-serializable + */ class ReflectionClassConstant implements Reflector { public string $name; @@ -492,6 +507,9 @@ class ReflectionClassConstant implements Reflector public function isEnumCase(): bool {} } +/** + * @not-serializable + */ class ReflectionParameter implements Reflector { public string $name; @@ -573,6 +591,9 @@ class ReflectionParameter implements Reflector public function getAttributes(?string $name = null, int $flags = 0): array {} } +/** + * @not-serializable + */ abstract class ReflectionType implements Stringable { /** @implementation-alias ReflectionClass::__clone */ @@ -603,6 +624,9 @@ class ReflectionIntersectionType extends ReflectionType public function getTypes(): array {} } +/** + * @not-serializable + */ class ReflectionExtension implements Reflector { public string $name; @@ -648,6 +672,9 @@ class ReflectionExtension implements Reflector public function isTemporary(): bool {} } +/** + * @not-serializable + */ class ReflectionZendExtension implements Reflector { public string $name; @@ -675,6 +702,9 @@ class ReflectionZendExtension implements Reflector public function getCopyright(): string {} } +/** + * @not-serializable + */ final class ReflectionReference { public static function fromArrayElement(array $array, int|string $key): ?ReflectionReference {} @@ -687,6 +717,9 @@ final class ReflectionReference private function __construct() {} } +/** + * @not-serializable + */ final class ReflectionAttribute implements Reflector { public function getName(): string {} @@ -737,6 +770,9 @@ final class ReflectionEnumBackedCase extends ReflectionEnumUnitCase public function getBackingValue(): int|string {} } +/** + * @not-serializable + */ final class ReflectionFiber { public function __construct(Fiber $fiber) {} diff --git a/ext/reflection/php_reflection_arginfo.h b/ext/reflection/php_reflection_arginfo.h index dac6136d638..d2a8c02659b 100644 --- a/ext/reflection/php_reflection_arginfo.h +++ b/ext/reflection/php_reflection_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 168c80203d91f05121c17835b775b9a00757e9da */ + * Stub hash: 49f7b49b187721a143fc54ea1eb4414805603dba */ ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_Reflection_getModifierNames, 0, 1, IS_ARRAY, 0) ZEND_ARG_TYPE_INFO(0, modifiers, IS_LONG, 0) @@ -1213,7 +1213,7 @@ static zend_class_entry *register_class_ReflectionFunctionAbstract(zend_class_en INIT_CLASS_ENTRY(ce, "ReflectionFunctionAbstract", class_ReflectionFunctionAbstract_methods); class_entry = zend_register_internal_class_ex(&ce, NULL); - class_entry->ce_flags |= ZEND_ACC_ABSTRACT; + class_entry->ce_flags |= ZEND_ACC_ABSTRACT|ZEND_ACC_NOT_SERIALIZABLE; zend_class_implements(class_entry, 1, class_entry_Reflector); zval property_name_default_value; @@ -1241,7 +1241,7 @@ static zend_class_entry *register_class_ReflectionGenerator(void) INIT_CLASS_ENTRY(ce, "ReflectionGenerator", class_ReflectionGenerator_methods); class_entry = zend_register_internal_class_ex(&ce, NULL); - class_entry->ce_flags |= ZEND_ACC_FINAL; + class_entry->ce_flags |= ZEND_ACC_FINAL|ZEND_ACC_NOT_SERIALIZABLE; return class_entry; } @@ -1268,6 +1268,7 @@ static zend_class_entry *register_class_ReflectionClass(zend_class_entry *class_ INIT_CLASS_ENTRY(ce, "ReflectionClass", class_ReflectionClass_methods); class_entry = zend_register_internal_class_ex(&ce, NULL); + class_entry->ce_flags |= ZEND_ACC_NOT_SERIALIZABLE; zend_class_implements(class_entry, 1, class_entry_Reflector); zval property_name_default_value; @@ -1295,6 +1296,7 @@ static zend_class_entry *register_class_ReflectionProperty(zend_class_entry *cla INIT_CLASS_ENTRY(ce, "ReflectionProperty", class_ReflectionProperty_methods); class_entry = zend_register_internal_class_ex(&ce, NULL); + class_entry->ce_flags |= ZEND_ACC_NOT_SERIALIZABLE; zend_class_implements(class_entry, 1, class_entry_Reflector); zval property_name_default_value; @@ -1318,6 +1320,7 @@ static zend_class_entry *register_class_ReflectionClassConstant(zend_class_entry INIT_CLASS_ENTRY(ce, "ReflectionClassConstant", class_ReflectionClassConstant_methods); class_entry = zend_register_internal_class_ex(&ce, NULL); + class_entry->ce_flags |= ZEND_ACC_NOT_SERIALIZABLE; zend_class_implements(class_entry, 1, class_entry_Reflector); zval property_name_default_value; @@ -1341,6 +1344,7 @@ static zend_class_entry *register_class_ReflectionParameter(zend_class_entry *cl INIT_CLASS_ENTRY(ce, "ReflectionParameter", class_ReflectionParameter_methods); class_entry = zend_register_internal_class_ex(&ce, NULL); + class_entry->ce_flags |= ZEND_ACC_NOT_SERIALIZABLE; zend_class_implements(class_entry, 1, class_entry_Reflector); zval property_name_default_value; @@ -1358,7 +1362,7 @@ static zend_class_entry *register_class_ReflectionType(zend_class_entry *class_e INIT_CLASS_ENTRY(ce, "ReflectionType", class_ReflectionType_methods); class_entry = zend_register_internal_class_ex(&ce, NULL); - class_entry->ce_flags |= ZEND_ACC_ABSTRACT; + class_entry->ce_flags |= ZEND_ACC_ABSTRACT|ZEND_ACC_NOT_SERIALIZABLE; zend_class_implements(class_entry, 1, class_entry_Stringable); return class_entry; @@ -1400,6 +1404,7 @@ static zend_class_entry *register_class_ReflectionExtension(zend_class_entry *cl INIT_CLASS_ENTRY(ce, "ReflectionExtension", class_ReflectionExtension_methods); class_entry = zend_register_internal_class_ex(&ce, NULL); + class_entry->ce_flags |= ZEND_ACC_NOT_SERIALIZABLE; zend_class_implements(class_entry, 1, class_entry_Reflector); zval property_name_default_value; @@ -1417,6 +1422,7 @@ static zend_class_entry *register_class_ReflectionZendExtension(zend_class_entry INIT_CLASS_ENTRY(ce, "ReflectionZendExtension", class_ReflectionZendExtension_methods); class_entry = zend_register_internal_class_ex(&ce, NULL); + class_entry->ce_flags |= ZEND_ACC_NOT_SERIALIZABLE; zend_class_implements(class_entry, 1, class_entry_Reflector); zval property_name_default_value; @@ -1434,7 +1440,7 @@ static zend_class_entry *register_class_ReflectionReference(void) INIT_CLASS_ENTRY(ce, "ReflectionReference", class_ReflectionReference_methods); class_entry = zend_register_internal_class_ex(&ce, NULL); - class_entry->ce_flags |= ZEND_ACC_FINAL; + class_entry->ce_flags |= ZEND_ACC_FINAL|ZEND_ACC_NOT_SERIALIZABLE; return class_entry; } @@ -1445,7 +1451,7 @@ static zend_class_entry *register_class_ReflectionAttribute(zend_class_entry *cl INIT_CLASS_ENTRY(ce, "ReflectionAttribute", class_ReflectionAttribute_methods); class_entry = zend_register_internal_class_ex(&ce, NULL); - class_entry->ce_flags |= ZEND_ACC_FINAL; + class_entry->ce_flags |= ZEND_ACC_FINAL|ZEND_ACC_NOT_SERIALIZABLE; zend_class_implements(class_entry, 1, class_entry_Reflector); return class_entry; @@ -1489,7 +1495,7 @@ static zend_class_entry *register_class_ReflectionFiber(void) INIT_CLASS_ENTRY(ce, "ReflectionFiber", class_ReflectionFiber_methods); class_entry = zend_register_internal_class_ex(&ce, NULL); - class_entry->ce_flags |= ZEND_ACC_FINAL; + class_entry->ce_flags |= ZEND_ACC_FINAL|ZEND_ACC_NOT_SERIALIZABLE; return class_entry; } diff --git a/ext/reflection/tests/ReflectionReference_errors.phpt b/ext/reflection/tests/ReflectionReference_errors.phpt index c9d75d0467a..8ef69e718a9 100644 --- a/ext/reflection/tests/ReflectionReference_errors.phpt +++ b/ext/reflection/tests/ReflectionReference_errors.phpt @@ -36,8 +36,11 @@ try { echo $e->getMessage(), "\n"; } -var_dump(unserialize('O:19:"ReflectionReference":0:{}')); - +try { + var_dump(unserialize('O:19:"ReflectionReference":0:{}')); +} catch (Exception $e) { + echo $e->getMessage(), "\n"; +} ?> --EXPECTF-- Call to private ReflectionReference::__construct() from global scope @@ -45,8 +48,4 @@ ReflectionReference::fromArrayElement(): Argument #1 ($array) must be of type ar ReflectionReference::fromArrayElement(): Argument #2 ($key) must be of type string|int, array given Array key not found Serialization of 'ReflectionReference' is not allowed - -Warning: Erroneous data format for unserializing 'ReflectionReference' in %s on line %d - -Notice: unserialize(): Error at offset 30 of 31 bytes in %s on line %d -bool(false) +Unserialization of 'ReflectionReference' is not allowed diff --git a/ext/reflection/tests/bug76737.phpt b/ext/reflection/tests/bug76737.phpt index 716b40e76a6..3fe1c5443ba 100644 --- a/ext/reflection/tests/bug76737.phpt +++ b/ext/reflection/tests/bug76737.phpt @@ -21,13 +21,8 @@ try { } catch (Exception $e) { echo $e->getMessage(), "\n"; } - ?> --EXPECTF-- Serialization of 'ReflectionClass' is not allowed Unserialization of 'ReflectionClass' is not allowed - -Warning: Erroneous data format for unserializing 'ReflectionClass' in %s on line %d - -Notice: unserialize(): Error at offset 26 of 27 bytes in %s on line %d -bool(false) +Unserialization of 'ReflectionClass' is not allowed diff --git a/ext/shmop/shmop.c b/ext/shmop/shmop.c index 8052dc77952..a33a5373b7f 100644 --- a/ext/shmop/shmop.c +++ b/ext/shmop/shmop.c @@ -23,7 +23,6 @@ #include "php.h" #include "php_ini.h" -#include "Zend/zend_interfaces.h" #include "php_shmop.h" #include "shmop_arginfo.h" @@ -110,8 +109,6 @@ PHP_MINIT_FUNCTION(shmop) { shmop_ce = register_class_Shmop(); shmop_ce->create_object = shmop_create_object; - shmop_ce->serialize = zend_class_serialize_deny; - shmop_ce->unserialize = zend_class_unserialize_deny; memcpy(&shmop_object_handlers, &std_object_handlers, sizeof(zend_object_handlers)); shmop_object_handlers.offset = XtOffsetOf(php_shmop, std); diff --git a/ext/shmop/shmop.stub.php b/ext/shmop/shmop.stub.php index dcf3e5ab03b..c9386cdfddc 100644 --- a/ext/shmop/shmop.stub.php +++ b/ext/shmop/shmop.stub.php @@ -2,7 +2,10 @@ /** @generate-class-entries */ -/** @strict-properties */ +/** + * @strict-properties + * @not-serializable + */ final class Shmop {} function shmop_open(int $key, string $mode, int $permissions, int $size): Shmop|false {} diff --git a/ext/shmop/shmop_arginfo.h b/ext/shmop/shmop_arginfo.h index db2c9221461..f8a51e19f49 100644 --- a/ext/shmop/shmop_arginfo.h +++ b/ext/shmop/shmop_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: be10d3d4ec73b674227600dcd975230290e4c2cd */ + * Stub hash: 6055f4edb68a7caed517dbb80f4d5265865dd91d */ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_shmop_open, 0, 4, Shmop, MAY_BE_FALSE) ZEND_ARG_TYPE_INFO(0, key, IS_LONG, 0) @@ -62,7 +62,7 @@ static zend_class_entry *register_class_Shmop(void) INIT_CLASS_ENTRY(ce, "Shmop", class_Shmop_methods); class_entry = zend_register_internal_class_ex(&ce, NULL); - class_entry->ce_flags |= ZEND_ACC_FINAL|ZEND_ACC_NO_DYNAMIC_PROPERTIES; + class_entry->ce_flags |= ZEND_ACC_FINAL|ZEND_ACC_NO_DYNAMIC_PROPERTIES|ZEND_ACC_NOT_SERIALIZABLE; return class_entry; } diff --git a/ext/simplexml/simplexml.c b/ext/simplexml/simplexml.c index 5dfc69689d1..8a95e353b51 100644 --- a/ext/simplexml/simplexml.c +++ b/ext/simplexml/simplexml.c @@ -2700,9 +2700,6 @@ PHP_MINIT_FUNCTION(simplexml) sxe_object_handlers.get_closure = NULL; sxe_object_handlers.get_gc = sxe_get_gc; - sxe_class_entry->serialize = zend_class_serialize_deny; - sxe_class_entry->unserialize = zend_class_unserialize_deny; - /* TODO: Why do we have two variables for this? */ ce_SimpleXMLElement = sxe_class_entry; diff --git a/ext/simplexml/simplexml.stub.php b/ext/simplexml/simplexml.stub.php index 789178cf286..d9e7e8b2bc8 100644 --- a/ext/simplexml/simplexml.stub.php +++ b/ext/simplexml/simplexml.stub.php @@ -8,6 +8,9 @@ function simplexml_load_string(string $data, ?string $class_name = SimpleXMLElem function simplexml_import_dom(SimpleXMLElement|DOMNode $node, ?string $class_name = SimpleXMLElement::class): ?SimpleXMLElement {} +/** + * @not-serializable + */ class SimpleXMLElement implements Stringable, Countable, RecursiveIterator { /** @tentative-return-type */ diff --git a/ext/simplexml/simplexml_arginfo.h b/ext/simplexml/simplexml_arginfo.h index 6adce7e7f7f..1dafd4fced8 100644 --- a/ext/simplexml/simplexml_arginfo.h +++ b/ext/simplexml/simplexml_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 2adc13ce6717fe2255ea7d9a3df56eeb8838d61d */ + * Stub hash: ca12ababd3c69ba80ef25487dde4d7bb67ec3dd4 */ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_simplexml_load_file, 0, 1, SimpleXMLElement, MAY_BE_FALSE) ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0) @@ -170,6 +170,7 @@ static zend_class_entry *register_class_SimpleXMLElement(zend_class_entry *class INIT_CLASS_ENTRY(ce, "SimpleXMLElement", class_SimpleXMLElement_methods); class_entry = zend_register_internal_class_ex(&ce, NULL); + class_entry->ce_flags |= ZEND_ACC_NOT_SERIALIZABLE; zend_class_implements(class_entry, 3, class_entry_Stringable, class_entry_Countable, class_entry_RecursiveIterator); return class_entry; diff --git a/ext/sockets/sockets.c b/ext/sockets/sockets.c index e760975f6c0..a82300114c2 100644 --- a/ext/sockets/sockets.c +++ b/ext/sockets/sockets.c @@ -28,7 +28,6 @@ #include "ext/standard/file.h" #include "ext/standard/info.h" #include "php_ini.h" -#include "zend_interfaces.h" #ifdef PHP_WIN32 # include "windows_common.h" # include @@ -436,8 +435,6 @@ static PHP_MINIT_FUNCTION(sockets) socket_ce = register_class_Socket(); socket_ce->create_object = socket_create_object; - socket_ce->serialize = zend_class_serialize_deny; - socket_ce->unserialize = zend_class_unserialize_deny; memcpy(&socket_object_handlers, &std_object_handlers, sizeof(zend_object_handlers)); socket_object_handlers.offset = XtOffsetOf(php_socket, std); @@ -449,8 +446,6 @@ static PHP_MINIT_FUNCTION(sockets) address_info_ce = register_class_AddressInfo(); address_info_ce->create_object = address_info_create_object; - address_info_ce->serialize = zend_class_serialize_deny; - address_info_ce->unserialize = zend_class_unserialize_deny; memcpy(&address_info_object_handlers, &std_object_handlers, sizeof(zend_object_handlers)); address_info_object_handlers.offset = XtOffsetOf(php_addrinfo, std); diff --git a/ext/sockets/sockets.stub.php b/ext/sockets/sockets.stub.php index 967041e98e5..2efa8c0a598 100644 --- a/ext/sockets/sockets.stub.php +++ b/ext/sockets/sockets.stub.php @@ -2,12 +2,18 @@ /** @generate-class-entries */ -/** @strict-properties */ +/** + * @strict-properties + * @not-serializable + */ final class Socket { } -/** @strict-properties */ +/** + * @strict-properties + * @not-serializable + */ final class AddressInfo { } diff --git a/ext/sockets/sockets_arginfo.h b/ext/sockets/sockets_arginfo.h index 2395fe00133..0971243d13d 100644 --- a/ext/sockets/sockets_arginfo.h +++ b/ext/sockets/sockets_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: aed25e8e90959fde6a454cf3b8d648feaf0ebad7 */ + * Stub hash: 7a34d96387ed5cba14a8a661f31b22bd88b2ec67 */ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_socket_select, 0, 4, MAY_BE_LONG|MAY_BE_FALSE) ZEND_ARG_TYPE_INFO(1, read, IS_ARRAY, 1) @@ -328,7 +328,7 @@ static zend_class_entry *register_class_Socket(void) INIT_CLASS_ENTRY(ce, "Socket", class_Socket_methods); class_entry = zend_register_internal_class_ex(&ce, NULL); - class_entry->ce_flags |= ZEND_ACC_FINAL|ZEND_ACC_NO_DYNAMIC_PROPERTIES; + class_entry->ce_flags |= ZEND_ACC_FINAL|ZEND_ACC_NO_DYNAMIC_PROPERTIES|ZEND_ACC_NOT_SERIALIZABLE; return class_entry; } @@ -339,7 +339,7 @@ static zend_class_entry *register_class_AddressInfo(void) INIT_CLASS_ENTRY(ce, "AddressInfo", class_AddressInfo_methods); class_entry = zend_register_internal_class_ex(&ce, NULL); - class_entry->ce_flags |= ZEND_ACC_FINAL|ZEND_ACC_NO_DYNAMIC_PROPERTIES; + class_entry->ce_flags |= ZEND_ACC_FINAL|ZEND_ACC_NO_DYNAMIC_PROPERTIES|ZEND_ACC_NOT_SERIALIZABLE; return class_entry; } diff --git a/ext/sqlite3/sqlite3.c b/ext/sqlite3/sqlite3.c index bd8fc5ec95b..7aec3b921a0 100644 --- a/ext/sqlite3/sqlite3.c +++ b/ext/sqlite3/sqlite3.c @@ -29,7 +29,6 @@ #include #include "zend_exceptions.h" -#include "zend_interfaces.h" #include "SAPI.h" ZEND_DECLARE_MODULE_GLOBALS(sqlite3) @@ -2350,8 +2349,6 @@ PHP_MINIT_FUNCTION(sqlite3) sqlite3_object_handlers.free_obj = php_sqlite3_object_free_storage; php_sqlite3_sc_entry = register_class_SQLite3(); php_sqlite3_sc_entry->create_object = php_sqlite3_object_new; - php_sqlite3_sc_entry->serialize = zend_class_serialize_deny; - php_sqlite3_sc_entry->unserialize = zend_class_unserialize_deny; /* Register SQLite 3 Prepared Statement Class */ sqlite3_stmt_object_handlers.offset = XtOffsetOf(php_sqlite3_stmt, zo); @@ -2359,8 +2356,6 @@ PHP_MINIT_FUNCTION(sqlite3) sqlite3_stmt_object_handlers.free_obj = php_sqlite3_stmt_object_free_storage; php_sqlite3_stmt_entry = register_class_SQLite3Stmt(); php_sqlite3_stmt_entry->create_object = php_sqlite3_stmt_object_new; - php_sqlite3_stmt_entry->serialize = zend_class_serialize_deny; - php_sqlite3_stmt_entry->unserialize = zend_class_unserialize_deny; /* Register SQLite 3 Result Class */ sqlite3_result_object_handlers.offset = XtOffsetOf(php_sqlite3_result, zo); @@ -2368,8 +2363,6 @@ PHP_MINIT_FUNCTION(sqlite3) sqlite3_result_object_handlers.free_obj = php_sqlite3_result_object_free_storage; php_sqlite3_result_entry = register_class_SQLite3Result(); php_sqlite3_result_entry->create_object = php_sqlite3_result_object_new; - php_sqlite3_result_entry->serialize = zend_class_serialize_deny; - php_sqlite3_result_entry->unserialize = zend_class_unserialize_deny; REGISTER_INI_ENTRIES(); diff --git a/ext/sqlite3/sqlite3.stub.php b/ext/sqlite3/sqlite3.stub.php index 6e44f78e7eb..8210d4b7cb1 100644 --- a/ext/sqlite3/sqlite3.stub.php +++ b/ext/sqlite3/sqlite3.stub.php @@ -2,6 +2,9 @@ /** @generate-class-entries */ +/** + * @not-serializable + */ class SQLite3 { /** @@ -84,6 +87,9 @@ class SQLite3 public function setAuthorizer(?callable $callback): bool {} } +/** + * @not-serializable + */ class SQLite3Stmt { private function __construct(SQLite3 $sqlite3, string $query) {} @@ -116,6 +122,9 @@ class SQLite3Stmt public function reset(): bool {} } +/** + * @not-serializable + */ class SQLite3Result { private function __construct() {} diff --git a/ext/sqlite3/sqlite3_arginfo.h b/ext/sqlite3/sqlite3_arginfo.h index 7e9b0c8a77c..d0a21e65a5e 100644 --- a/ext/sqlite3/sqlite3_arginfo.h +++ b/ext/sqlite3/sqlite3_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 1d18ea0592ade188628e23fa6a65c06b36837c44 */ + * Stub hash: 1f1163829fdffd8a4512f3fd9fd9c6c07238ed34 */ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SQLite3___construct, 0, 0, 1) ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0) @@ -276,6 +276,7 @@ static zend_class_entry *register_class_SQLite3(void) INIT_CLASS_ENTRY(ce, "SQLite3", class_SQLite3_methods); class_entry = zend_register_internal_class_ex(&ce, NULL); + class_entry->ce_flags |= ZEND_ACC_NOT_SERIALIZABLE; return class_entry; } @@ -286,6 +287,7 @@ static zend_class_entry *register_class_SQLite3Stmt(void) INIT_CLASS_ENTRY(ce, "SQLite3Stmt", class_SQLite3Stmt_methods); class_entry = zend_register_internal_class_ex(&ce, NULL); + class_entry->ce_flags |= ZEND_ACC_NOT_SERIALIZABLE; return class_entry; } @@ -296,6 +298,7 @@ static zend_class_entry *register_class_SQLite3Result(void) INIT_CLASS_ENTRY(ce, "SQLite3Result", class_SQLite3Result_methods); class_entry = zend_register_internal_class_ex(&ce, NULL); + class_entry->ce_flags |= ZEND_ACC_NOT_SERIALIZABLE; return class_entry; } diff --git a/ext/sysvmsg/sysvmsg.c b/ext/sysvmsg/sysvmsg.c index c77dd47cec5..7cef2fe2339 100644 --- a/ext/sysvmsg/sysvmsg.c +++ b/ext/sysvmsg/sysvmsg.c @@ -25,7 +25,6 @@ #include "sysvmsg_arginfo.h" #include "ext/standard/php_var.h" #include "zend_smart_str.h" -#include "Zend/zend_interfaces.h" #include #include @@ -110,8 +109,6 @@ PHP_MINIT_FUNCTION(sysvmsg) { sysvmsg_queue_ce = register_class_SysvMessageQueue(); sysvmsg_queue_ce->create_object = sysvmsg_queue_create_object; - sysvmsg_queue_ce->serialize = zend_class_serialize_deny; - sysvmsg_queue_ce->unserialize = zend_class_unserialize_deny; memcpy(&sysvmsg_queue_object_handlers, &std_object_handlers, sizeof(zend_object_handlers)); sysvmsg_queue_object_handlers.offset = XtOffsetOf(sysvmsg_queue_t, std); diff --git a/ext/sysvmsg/sysvmsg.stub.php b/ext/sysvmsg/sysvmsg.stub.php index 5ec72a48372..efc07ffc1ff 100644 --- a/ext/sysvmsg/sysvmsg.stub.php +++ b/ext/sysvmsg/sysvmsg.stub.php @@ -2,7 +2,10 @@ /** @generate-class-entries */ -/** @strict-properties */ +/** + * @strict-properties + * @not-serializable + */ final class SysvMessageQueue { } diff --git a/ext/sysvmsg/sysvmsg_arginfo.h b/ext/sysvmsg/sysvmsg_arginfo.h index 3cef169fb14..1fd483738f9 100644 --- a/ext/sysvmsg/sysvmsg_arginfo.h +++ b/ext/sysvmsg/sysvmsg_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 6744b81ba4b0b5db62ffe04255c35519e17be7c2 */ + * Stub hash: 7acab08abf78d75df333fccd6c47266823a92103 */ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_msg_get_queue, 0, 1, SysvMessageQueue, MAY_BE_FALSE) ZEND_ARG_TYPE_INFO(0, key, IS_LONG, 0) @@ -75,7 +75,7 @@ static zend_class_entry *register_class_SysvMessageQueue(void) INIT_CLASS_ENTRY(ce, "SysvMessageQueue", class_SysvMessageQueue_methods); class_entry = zend_register_internal_class_ex(&ce, NULL); - class_entry->ce_flags |= ZEND_ACC_FINAL|ZEND_ACC_NO_DYNAMIC_PROPERTIES; + class_entry->ce_flags |= ZEND_ACC_FINAL|ZEND_ACC_NO_DYNAMIC_PROPERTIES|ZEND_ACC_NOT_SERIALIZABLE; return class_entry; } diff --git a/ext/sysvsem/sysvsem.c b/ext/sysvsem/sysvsem.c index b4f8848c134..42fb1d96c6f 100644 --- a/ext/sysvsem/sysvsem.c +++ b/ext/sysvsem/sysvsem.c @@ -31,7 +31,6 @@ #include "sysvsem_arginfo.h" #include "php_sysvsem.h" #include "ext/standard/info.h" -#include "Zend/zend_interfaces.h" #if !HAVE_SEMUN @@ -153,8 +152,6 @@ PHP_MINIT_FUNCTION(sysvsem) { sysvsem_ce = register_class_SysvSemaphore(); sysvsem_ce->create_object = sysvsem_create_object; - sysvsem_ce->serialize = zend_class_serialize_deny; - sysvsem_ce->unserialize = zend_class_unserialize_deny; memcpy(&sysvsem_object_handlers, &std_object_handlers, sizeof(zend_object_handlers)); sysvsem_object_handlers.offset = XtOffsetOf(sysvsem_sem, std); diff --git a/ext/sysvsem/sysvsem.stub.php b/ext/sysvsem/sysvsem.stub.php index 40cb9b5d3ee..d8e10a5f917 100644 --- a/ext/sysvsem/sysvsem.stub.php +++ b/ext/sysvsem/sysvsem.stub.php @@ -2,7 +2,10 @@ /** @generate-class-entries */ -/** @strict-properties */ +/** + * @strict-properties + * @not-serializable + */ final class SysvSemaphore { } diff --git a/ext/sysvsem/sysvsem_arginfo.h b/ext/sysvsem/sysvsem_arginfo.h index 54798ff5e5b..11ec38db483 100644 --- a/ext/sysvsem/sysvsem_arginfo.h +++ b/ext/sysvsem/sysvsem_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: dd7be82f586ef5f9221268ae90e959e8cccdcacf */ + * Stub hash: 946ea9d0d2156ced1bac460d7d5fc3420e1934bb */ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_sem_get, 0, 1, SysvSemaphore, MAY_BE_FALSE) ZEND_ARG_TYPE_INFO(0, key, IS_LONG, 0) @@ -45,7 +45,7 @@ static zend_class_entry *register_class_SysvSemaphore(void) INIT_CLASS_ENTRY(ce, "SysvSemaphore", class_SysvSemaphore_methods); class_entry = zend_register_internal_class_ex(&ce, NULL); - class_entry->ce_flags |= ZEND_ACC_FINAL|ZEND_ACC_NO_DYNAMIC_PROPERTIES; + class_entry->ce_flags |= ZEND_ACC_FINAL|ZEND_ACC_NO_DYNAMIC_PROPERTIES|ZEND_ACC_NOT_SERIALIZABLE; return class_entry; } diff --git a/ext/sysvshm/sysvshm.c b/ext/sysvshm/sysvshm.c index 6bf45fc984a..717c75337bb 100644 --- a/ext/sysvshm/sysvshm.c +++ b/ext/sysvshm/sysvshm.c @@ -29,7 +29,6 @@ #include "ext/standard/info.h" #include "ext/standard/php_var.h" #include "zend_smart_str.h" -#include "Zend/zend_interfaces.h" #include "php_ini.h" /* SysvSharedMemory class */ @@ -102,8 +101,6 @@ PHP_MINIT_FUNCTION(sysvshm) { sysvshm_ce = register_class_SysvSharedMemory(); sysvshm_ce->create_object = sysvshm_create_object; - sysvshm_ce->serialize = zend_class_serialize_deny; - sysvshm_ce->unserialize = zend_class_unserialize_deny; memcpy(&sysvshm_object_handlers, &std_object_handlers, sizeof(zend_object_handlers)); sysvshm_object_handlers.offset = XtOffsetOf(sysvshm_shm, std); diff --git a/ext/sysvshm/sysvshm.stub.php b/ext/sysvshm/sysvshm.stub.php index d874435b062..4b6770063a3 100644 --- a/ext/sysvshm/sysvshm.stub.php +++ b/ext/sysvshm/sysvshm.stub.php @@ -2,7 +2,10 @@ /** @generate-class-entries */ -/** @strict-properties */ +/** + * @strict-properties + * @not-serializable + */ final class SysvSharedMemory { } diff --git a/ext/sysvshm/sysvshm_arginfo.h b/ext/sysvshm/sysvshm_arginfo.h index 7dcb9b4b1ce..cee9f7783ba 100644 --- a/ext/sysvshm/sysvshm_arginfo.h +++ b/ext/sysvshm/sysvshm_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 033437611b589798fe9771e6dd2e95d2fbc999d4 */ + * Stub hash: 93677b78d9aaa4d6dbb5d1dcf3e79a8418add5c0 */ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_shm_attach, 0, 1, SysvSharedMemory, MAY_BE_FALSE) ZEND_ARG_TYPE_INFO(0, key, IS_LONG, 0) @@ -63,7 +63,7 @@ static zend_class_entry *register_class_SysvSharedMemory(void) INIT_CLASS_ENTRY(ce, "SysvSharedMemory", class_SysvSharedMemory_methods); class_entry = zend_register_internal_class_ex(&ce, NULL); - class_entry->ce_flags |= ZEND_ACC_FINAL|ZEND_ACC_NO_DYNAMIC_PROPERTIES; + class_entry->ce_flags |= ZEND_ACC_FINAL|ZEND_ACC_NO_DYNAMIC_PROPERTIES|ZEND_ACC_NOT_SERIALIZABLE; return class_entry; } diff --git a/ext/xml/xml.c b/ext/xml/xml.c index f775adb4450..58c62f5b718 100644 --- a/ext/xml/xml.c +++ b/ext/xml/xml.c @@ -26,7 +26,6 @@ #include "ext/standard/php_string.h" #include "ext/standard/info.h" #include "ext/standard/html.h" -#include "zend_interfaces.h" #ifdef HAVE_XML @@ -255,8 +254,6 @@ PHP_MINIT_FUNCTION(xml) { xml_parser_ce = register_class_XMLParser(); xml_parser_ce->create_object = xml_parser_create_object; - xml_parser_ce->serialize = zend_class_serialize_deny; - xml_parser_ce->unserialize = zend_class_unserialize_deny; memcpy(&xml_parser_object_handlers, &std_object_handlers, sizeof(zend_object_handlers)); xml_parser_object_handlers.offset = XtOffsetOf(xml_parser, std); diff --git a/ext/xml/xml.stub.php b/ext/xml/xml.stub.php index be52bf3e3f7..52fb390072b 100644 --- a/ext/xml/xml.stub.php +++ b/ext/xml/xml.stub.php @@ -63,7 +63,10 @@ function xml_parser_set_option(XMLParser $parser, int $option, $value): bool {} function xml_parser_get_option(XMLParser $parser, int $option): string|int {} -/** @strict-properties */ +/** + * @strict-properties + * @not-serializable + */ final class XMLParser { } diff --git a/ext/xml/xml_arginfo.h b/ext/xml/xml_arginfo.h index 689826aa0c0..27694bbf808 100644 --- a/ext/xml/xml_arginfo.h +++ b/ext/xml/xml_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 3c786a3b1d8dc889dd3079bbc7f389d8dc3e11a5 */ + * Stub hash: 9fbea7ff70c94733c7c68f2a8b9b33ab1b32b0a5 */ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_xml_parser_create, 0, 0, XMLParser, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, encoding, IS_STRING, 1, "null") @@ -144,7 +144,7 @@ static zend_class_entry *register_class_XMLParser(void) INIT_CLASS_ENTRY(ce, "XMLParser", class_XMLParser_methods); class_entry = zend_register_internal_class_ex(&ce, NULL); - class_entry->ce_flags |= ZEND_ACC_FINAL|ZEND_ACC_NO_DYNAMIC_PROPERTIES; + class_entry->ce_flags |= ZEND_ACC_FINAL|ZEND_ACC_NO_DYNAMIC_PROPERTIES|ZEND_ACC_NOT_SERIALIZABLE; return class_entry; } diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c index a9b8d36fa87..81a23c48c84 100644 --- a/ext/zlib/zlib.c +++ b/ext/zlib/zlib.c @@ -29,7 +29,6 @@ #include "ext/standard/php_string.h" #include "php_zlib.h" #include "zlib_arginfo.h" -#include "Zend/zend_interfaces.h" /* * zlib include files can define the following preprocessor defines which rename @@ -1341,8 +1340,6 @@ static PHP_MINIT_FUNCTION(zlib) inflate_context_ce = register_class_InflateContext(); inflate_context_ce->create_object = inflate_context_create_object; - inflate_context_ce->serialize = zend_class_serialize_deny; - inflate_context_ce->unserialize = zend_class_unserialize_deny; memcpy(&inflate_context_object_handlers, &std_object_handlers, sizeof(zend_object_handlers)); inflate_context_object_handlers.offset = XtOffsetOf(php_zlib_context, std); @@ -1353,8 +1350,6 @@ static PHP_MINIT_FUNCTION(zlib) deflate_context_ce = register_class_DeflateContext(); deflate_context_ce->create_object = deflate_context_create_object; - deflate_context_ce->serialize = zend_class_serialize_deny; - deflate_context_ce->unserialize = zend_class_unserialize_deny; memcpy(&deflate_context_object_handlers, &std_object_handlers, sizeof(zend_object_handlers)); deflate_context_object_handlers.offset = XtOffsetOf(php_zlib_context, std); diff --git a/ext/zlib/zlib.stub.php b/ext/zlib/zlib.stub.php index 1aaafcdce22..f1a53acf604 100644 --- a/ext/zlib/zlib.stub.php +++ b/ext/zlib/zlib.stub.php @@ -2,12 +2,18 @@ /** @generate-class-entries */ -/** @strict-properties */ +/** + * @strict-properties + * @not-serializable + */ final class InflateContext { } -/** @strict-properties */ +/** + * @strict-properties + * @not-serializable + */ final class DeflateContext { } diff --git a/ext/zlib/zlib_arginfo.h b/ext/zlib/zlib_arginfo.h index e0ff0e16e99..582877b6299 100644 --- a/ext/zlib/zlib_arginfo.h +++ b/ext/zlib/zlib_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 1aa5f9d6d062280f6148f3e72ceeaca81fb3037e */ + * Stub hash: 2e3212e4cbb2fdeb5fc1342b19590bc89ae5d31a */ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_ob_gzhandler, 0, 2, MAY_BE_STRING|MAY_BE_FALSE) ZEND_ARG_TYPE_INFO(0, data, IS_STRING, 0) @@ -214,7 +214,7 @@ static zend_class_entry *register_class_InflateContext(void) INIT_CLASS_ENTRY(ce, "InflateContext", class_InflateContext_methods); class_entry = zend_register_internal_class_ex(&ce, NULL); - class_entry->ce_flags |= ZEND_ACC_FINAL|ZEND_ACC_NO_DYNAMIC_PROPERTIES; + class_entry->ce_flags |= ZEND_ACC_FINAL|ZEND_ACC_NO_DYNAMIC_PROPERTIES|ZEND_ACC_NOT_SERIALIZABLE; return class_entry; } @@ -225,7 +225,7 @@ static zend_class_entry *register_class_DeflateContext(void) INIT_CLASS_ENTRY(ce, "DeflateContext", class_DeflateContext_methods); class_entry = zend_register_internal_class_ex(&ce, NULL); - class_entry->ce_flags |= ZEND_ACC_FINAL|ZEND_ACC_NO_DYNAMIC_PROPERTIES; + class_entry->ce_flags |= ZEND_ACC_FINAL|ZEND_ACC_NO_DYNAMIC_PROPERTIES|ZEND_ACC_NOT_SERIALIZABLE; return class_entry; }