Not serializable flag permeation

This commit is contained in:
Joe Watkins 2021-07-20 05:35:44 +02:00
parent b382883696
commit 570d9b63e9
No known key found for this signature in database
GPG key ID: F9BA0ADA31CBD89E
89 changed files with 331 additions and 287 deletions

View file

@ -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"

View file

@ -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);

View file

@ -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 */

View file

@ -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;

View file

@ -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();

View file

@ -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) {}

View file

@ -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;
}

View file

@ -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

View file

@ -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
{
}

View file

@ -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;
}

View file

@ -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();
}

View file

@ -2,6 +2,9 @@
/** @generate-class-entries */
/**
* @not-serializable
*/
class CURLFile
{
public string $name = "";

View file

@ -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);

View file

@ -21,7 +21,6 @@
#endif
#include "php.h"
#include "Zend/zend_interfaces.h"
#include "Zend/zend_exceptions.h"
#include <stdio.h>
@ -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);

View file

@ -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);

View file

@ -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);

View file

@ -4,7 +4,6 @@ Bug #73147: Use After Free in PHP7 unserialize()
curl
--FILE--
<?php
$poc = 'a:1:{i:0;O:8:"CURLFile":1:{s:4:"name";R:1;}}';
try {
var_dump(unserialize($poc));
@ -12,8 +11,5 @@ try {
echo $e->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

View file

@ -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 <enchant.h>
@ -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);

View file

@ -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
{
}

View file

@ -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;
}

View file

@ -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;

View file

@ -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 {}

View file

@ -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;
}

View file

@ -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));

View file

@ -2,6 +2,9 @@
/** @generate-class-entries */
/**
* @not-serializable
*/
class finfo
{
/** @alias finfo_open */

View file

@ -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;
}

View file

@ -4,7 +4,10 @@
namespace FTP {
/** @strict-properties */
/**
* @strict-properties
* @not-serializable
*/
final class Connection
{
}

View file

@ -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;
}

View file

@ -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);

View file

@ -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 <sys/wait.h>
@ -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));

View file

@ -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 {}

View file

@ -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;
}

View file

@ -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);

View file

@ -4,7 +4,10 @@
namespace IMAP {
/** @strict-properties */
/**
* @strict-properties
* @not-serializable
*/
final class Connection {
}

View file

@ -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;
}

View file

@ -2,6 +2,9 @@
/** @generate-class-entries */
/**
* @not-serializable
*/
class NumberFormatter
{
public function __construct(string $locale, int $style, ?string $pattern = null) {}

View file

@ -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;
}

View file

@ -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));

View file

@ -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 <string.h>
@ -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);

View file

@ -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
{
}

View file

@ -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;
}

View file

@ -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);

View file

@ -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);

View file

@ -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
{
}

View file

@ -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;
}

View file

@ -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);

View file

@ -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) {}

View file

@ -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;
}

View file

@ -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;

View file

@ -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;

View file

@ -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);

View file

@ -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);

View file

@ -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
{
}

View file

@ -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;
}

View file

@ -19,7 +19,6 @@
#endif
#include "php.h"
#include "zend_interfaces.h"
#include <stdlib.h>
#include <ctype.h>
@ -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;

View file

@ -4,10 +4,16 @@
namespace PSpell {
/** @strict-properties */
/**
* @strict-properties
* @not-serializable
*/
final class Dictionary {}
/** @strict-properties */
/**
* @strict-properties
* @not-serializable
*/
final class Config {}
}

View file

@ -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;
}

View file

@ -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);

View file

@ -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) {}

View file

@ -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;
}

View file

@ -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

View file

@ -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

View file

@ -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);

View file

@ -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 {}

View file

@ -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;
}

View file

@ -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;

View file

@ -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 */

View file

@ -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;

View file

@ -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 <win32/inet.h>
@ -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);

View file

@ -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
{
}

View file

@ -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;
}

View file

@ -29,7 +29,6 @@
#include <sqlite3.h>
#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();

View file

@ -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() {}

View file

@ -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;
}

View file

@ -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 <sys/types.h>
#include <sys/ipc.h>
@ -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);

View file

@ -2,7 +2,10 @@
/** @generate-class-entries */
/** @strict-properties */
/**
* @strict-properties
* @not-serializable
*/
final class SysvMessageQueue
{
}

View file

@ -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;
}

View file

@ -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);

View file

@ -2,7 +2,10 @@
/** @generate-class-entries */
/** @strict-properties */
/**
* @strict-properties
* @not-serializable
*/
final class SysvSemaphore
{
}

View file

@ -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;
}

View file

@ -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);

View file

@ -2,7 +2,10 @@
/** @generate-class-entries */
/** @strict-properties */
/**
* @strict-properties
* @not-serializable
*/
final class SysvSharedMemory
{
}

View file

@ -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;
}

View file

@ -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);

View file

@ -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
{
}

View file

@ -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;
}

View file

@ -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);

View file

@ -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
{
}

View file

@ -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;
}