1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

Merge branch 'PHP-8.0'

* PHP-8.0:
  Mark resource-like objects as non-comparable
This commit is contained in:
Nikita Popov
2021-02-16 14:22:03 +01:00
13 changed files with 17 additions and 0 deletions

View File

@@ -1189,6 +1189,7 @@ PHP_MINIT_FUNCTION(curl)
curl_object_handlers.get_constructor = curl_get_constructor;
curl_object_handlers.clone_obj = curl_clone_obj;
curl_object_handlers.cast_object = curl_cast_object;
curl_object_handlers.compare = zend_objects_not_comparable;
curl_multi_ce = register_class_CurlMultiHandle();
curl_multi_register_handlers();

View File

@@ -592,4 +592,5 @@ void curl_multi_register_handlers(void) {
curl_multi_handlers.get_constructor = curl_multi_get_constructor;
curl_multi_handlers.clone_obj = NULL;
curl_multi_handlers.cast_object = curl_cast_object;
curl_multi_handlers.compare = zend_objects_not_comparable;
}

View File

@@ -172,4 +172,5 @@ void curl_share_register_handlers(void) {
curl_share_handlers.free_obj = curl_share_free_obj;
curl_share_handlers.get_constructor = curl_share_get_constructor;
curl_share_handlers.clone_obj = NULL;
curl_share_handlers.compare = zend_objects_not_comparable;
}

View File

@@ -195,6 +195,7 @@ PHP_MINIT_FUNCTION(enchant)
enchant_broker_handlers.offset = XtOffsetOf(enchant_broker, std);
enchant_broker_handlers.free_obj = php_enchant_broker_free;
enchant_broker_handlers.clone_obj = NULL;
enchant_broker_handlers.compare = zend_objects_not_comparable;
enchant_dict_ce = register_class_EnchantDictionary();
enchant_dict_ce->create_object = enchant_dict_create_object;
@@ -205,6 +206,7 @@ PHP_MINIT_FUNCTION(enchant)
enchant_dict_handlers.offset = XtOffsetOf(enchant_dict, std);
enchant_dict_handlers.free_obj = php_enchant_dict_free;
enchant_dict_handlers.clone_obj = NULL;
enchant_dict_handlers.compare = zend_objects_not_comparable;
REGISTER_LONG_CONSTANT("ENCHANT_MYSPELL", PHP_ENCHANT_MYSPELL, CONST_CS | CONST_PERSISTENT | CONST_DEPRECATED);
REGISTER_LONG_CONSTANT("ENCHANT_ISPELL", PHP_ENCHANT_ISPELL, CONST_CS | CONST_PERSISTENT | CONST_DEPRECATED);

View File

@@ -227,6 +227,7 @@ static void php_gd_object_minit_helper()
php_gd_image_object_handlers.clone_obj = NULL;
php_gd_image_object_handlers.free_obj = php_gd_image_object_free;
php_gd_image_object_handlers.get_constructor = php_gd_image_object_get_constructor;
php_gd_image_object_handlers.compare = zend_objects_not_comparable;
php_gd_image_object_handlers.offset = XtOffsetOf(php_gd_image_object, std);
}

View File

@@ -1113,6 +1113,7 @@ PHP_MINIT_FUNCTION(openssl)
php_openssl_certificate_object_handlers.free_obj = php_openssl_certificate_free_obj;
php_openssl_certificate_object_handlers.get_constructor = php_openssl_certificate_get_constructor;
php_openssl_certificate_object_handlers.clone_obj = NULL;
php_openssl_certificate_object_handlers.compare = zend_objects_not_comparable;
php_openssl_request_ce = register_class_OpenSSLCertificateSigningRequest();
php_openssl_request_ce->create_object = php_openssl_request_create_object;
@@ -1124,6 +1125,7 @@ PHP_MINIT_FUNCTION(openssl)
php_openssl_request_object_handlers.free_obj = php_openssl_request_free_obj;
php_openssl_request_object_handlers.get_constructor = php_openssl_request_get_constructor;
php_openssl_request_object_handlers.clone_obj = NULL;
php_openssl_request_object_handlers.compare = zend_objects_not_comparable;
php_openssl_pkey_ce = register_class_OpenSSLAsymmetricKey();
php_openssl_pkey_ce->create_object = php_openssl_pkey_create_object;
@@ -1135,6 +1137,7 @@ PHP_MINIT_FUNCTION(openssl)
php_openssl_pkey_object_handlers.free_obj = php_openssl_pkey_free_obj;
php_openssl_pkey_object_handlers.get_constructor = php_openssl_pkey_get_constructor;
php_openssl_pkey_object_handlers.clone_obj = NULL;
php_openssl_pkey_object_handlers.compare = zend_objects_not_comparable;
#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined (LIBRESSL_VERSION_NUMBER)
OPENSSL_config(NULL);

View File

@@ -118,6 +118,7 @@ PHP_MINIT_FUNCTION(shmop)
shmop_object_handlers.free_obj = shmop_free_obj;
shmop_object_handlers.get_constructor = shmop_get_constructor;
shmop_object_handlers.clone_obj = NULL;
shmop_object_handlers.compare = zend_objects_not_comparable;
return SUCCESS;
}

View File

@@ -455,6 +455,7 @@ static PHP_MINIT_FUNCTION(sockets)
address_info_object_handlers.free_obj = address_info_free_obj;
address_info_object_handlers.get_constructor = address_info_get_constructor;
address_info_object_handlers.clone_obj = NULL;
address_info_object_handlers.compare = zend_objects_not_comparable;
REGISTER_LONG_CONSTANT("AF_UNIX", AF_UNIX, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("AF_INET", AF_INET, CONST_CS | CONST_PERSISTENT);

View File

@@ -118,6 +118,7 @@ PHP_MINIT_FUNCTION(sysvmsg)
sysvmsg_queue_object_handlers.free_obj = sysvmsg_queue_free_obj;
sysvmsg_queue_object_handlers.get_constructor = sysvmsg_queue_get_constructor;
sysvmsg_queue_object_handlers.clone_obj = NULL;
sysvmsg_queue_object_handlers.compare = zend_objects_not_comparable;
REGISTER_LONG_CONSTANT("MSG_IPC_NOWAIT", PHP_MSG_IPC_NOWAIT, CONST_PERSISTENT|CONST_CS);
REGISTER_LONG_CONSTANT("MSG_EAGAIN", EAGAIN, CONST_PERSISTENT|CONST_CS);

View File

@@ -161,6 +161,7 @@ PHP_MINIT_FUNCTION(sysvsem)
sysvsem_object_handlers.free_obj = sysvsem_free_obj;
sysvsem_object_handlers.get_constructor = sysvsem_get_constructor;
sysvsem_object_handlers.clone_obj = NULL;
sysvsem_object_handlers.compare = zend_objects_not_comparable;
return SUCCESS;
}

View File

@@ -109,6 +109,7 @@ PHP_MINIT_FUNCTION(sysvshm)
sysvshm_object_handlers.free_obj = sysvshm_free_obj;
sysvshm_object_handlers.get_constructor = sysvshm_get_constructor;
sysvshm_object_handlers.clone_obj = NULL;
sysvshm_object_handlers.compare = zend_objects_not_comparable;
if (cfg_get_long("sysvshm.init_mem", &php_sysvshm.init_mem) == FAILURE) {
php_sysvshm.init_mem=10000;

View File

@@ -264,6 +264,7 @@ PHP_MINIT_FUNCTION(xml)
xml_parser_object_handlers.get_gc = xml_parser_get_gc;
xml_parser_object_handlers.get_constructor = xml_parser_get_constructor;
xml_parser_object_handlers.clone_obj = NULL;
xml_parser_object_handlers.compare = zend_objects_not_comparable;
REGISTER_LONG_CONSTANT("XML_ERROR_NONE", XML_ERROR_NONE, CONST_CS|CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("XML_ERROR_NO_MEMORY", XML_ERROR_NO_MEMORY, CONST_CS|CONST_PERSISTENT);

View File

@@ -1350,6 +1350,7 @@ static PHP_MINIT_FUNCTION(zlib)
inflate_context_object_handlers.free_obj = inflate_context_free_obj;
inflate_context_object_handlers.get_constructor = inflate_context_get_constructor;
inflate_context_object_handlers.clone_obj = NULL;
inflate_context_object_handlers.compare = zend_objects_not_comparable;
zend_class_entry deflate_ce;
INIT_CLASS_ENTRY(deflate_ce, "DeflateContext", class_DeflateContext_methods);
@@ -1364,6 +1365,7 @@ static PHP_MINIT_FUNCTION(zlib)
deflate_context_object_handlers.free_obj = deflate_context_free_obj;
deflate_context_object_handlers.get_constructor = deflate_context_get_constructor;
deflate_context_object_handlers.clone_obj = NULL;
deflate_context_object_handlers.compare = zend_objects_not_comparable;
REGISTER_LONG_CONSTANT("FORCE_GZIP", PHP_ZLIB_ENCODING_GZIP, CONST_CS|CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("FORCE_DEFLATE", PHP_ZLIB_ENCODING_DEFLATE, CONST_CS|CONST_PERSISTENT);