Skip to content

Commit ce0bc58

Browse files
committed
Merge branch 'PHP-8.0'
* PHP-8.0: Mark resource-like objects as non-comparable
2 parents 081349f + b63ea10 commit ce0bc58

File tree

13 files changed

+17
-0
lines changed

13 files changed

+17
-0
lines changed

Diff for: ext/curl/interface.c

+1
Original file line numberDiff line numberDiff line change
@@ -1189,6 +1189,7 @@ PHP_MINIT_FUNCTION(curl)
11891189
curl_object_handlers.get_constructor = curl_get_constructor;
11901190
curl_object_handlers.clone_obj = curl_clone_obj;
11911191
curl_object_handlers.cast_object = curl_cast_object;
1192+
curl_object_handlers.compare = zend_objects_not_comparable;
11921193

11931194
curl_multi_ce = register_class_CurlMultiHandle();
11941195
curl_multi_register_handlers();

Diff for: ext/curl/multi.c

+1
Original file line numberDiff line numberDiff line change
@@ -592,4 +592,5 @@ void curl_multi_register_handlers(void) {
592592
curl_multi_handlers.get_constructor = curl_multi_get_constructor;
593593
curl_multi_handlers.clone_obj = NULL;
594594
curl_multi_handlers.cast_object = curl_cast_object;
595+
curl_multi_handlers.compare = zend_objects_not_comparable;
595596
}

Diff for: ext/curl/share.c

+1
Original file line numberDiff line numberDiff line change
@@ -172,4 +172,5 @@ void curl_share_register_handlers(void) {
172172
curl_share_handlers.free_obj = curl_share_free_obj;
173173
curl_share_handlers.get_constructor = curl_share_get_constructor;
174174
curl_share_handlers.clone_obj = NULL;
175+
curl_share_handlers.compare = zend_objects_not_comparable;
175176
}

Diff for: ext/enchant/enchant.c

+2
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,7 @@ PHP_MINIT_FUNCTION(enchant)
195195
enchant_broker_handlers.offset = XtOffsetOf(enchant_broker, std);
196196
enchant_broker_handlers.free_obj = php_enchant_broker_free;
197197
enchant_broker_handlers.clone_obj = NULL;
198+
enchant_broker_handlers.compare = zend_objects_not_comparable;
198199

199200
enchant_dict_ce = register_class_EnchantDictionary();
200201
enchant_dict_ce->create_object = enchant_dict_create_object;
@@ -205,6 +206,7 @@ PHP_MINIT_FUNCTION(enchant)
205206
enchant_dict_handlers.offset = XtOffsetOf(enchant_dict, std);
206207
enchant_dict_handlers.free_obj = php_enchant_dict_free;
207208
enchant_dict_handlers.clone_obj = NULL;
209+
enchant_dict_handlers.compare = zend_objects_not_comparable;
208210

209211
REGISTER_LONG_CONSTANT("ENCHANT_MYSPELL", PHP_ENCHANT_MYSPELL, CONST_CS | CONST_PERSISTENT | CONST_DEPRECATED);
210212
REGISTER_LONG_CONSTANT("ENCHANT_ISPELL", PHP_ENCHANT_ISPELL, CONST_CS | CONST_PERSISTENT | CONST_DEPRECATED);

Diff for: ext/gd/gd.c

+1
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,7 @@ static void php_gd_object_minit_helper()
227227
php_gd_image_object_handlers.clone_obj = NULL;
228228
php_gd_image_object_handlers.free_obj = php_gd_image_object_free;
229229
php_gd_image_object_handlers.get_constructor = php_gd_image_object_get_constructor;
230+
php_gd_image_object_handlers.compare = zend_objects_not_comparable;
230231
php_gd_image_object_handlers.offset = XtOffsetOf(php_gd_image_object, std);
231232
}
232233

Diff for: ext/openssl/openssl.c

+3
Original file line numberDiff line numberDiff line change
@@ -1113,6 +1113,7 @@ PHP_MINIT_FUNCTION(openssl)
11131113
php_openssl_certificate_object_handlers.free_obj = php_openssl_certificate_free_obj;
11141114
php_openssl_certificate_object_handlers.get_constructor = php_openssl_certificate_get_constructor;
11151115
php_openssl_certificate_object_handlers.clone_obj = NULL;
1116+
php_openssl_certificate_object_handlers.compare = zend_objects_not_comparable;
11161117

11171118
php_openssl_request_ce = register_class_OpenSSLCertificateSigningRequest();
11181119
php_openssl_request_ce->create_object = php_openssl_request_create_object;
@@ -1124,6 +1125,7 @@ PHP_MINIT_FUNCTION(openssl)
11241125
php_openssl_request_object_handlers.free_obj = php_openssl_request_free_obj;
11251126
php_openssl_request_object_handlers.get_constructor = php_openssl_request_get_constructor;
11261127
php_openssl_request_object_handlers.clone_obj = NULL;
1128+
php_openssl_request_object_handlers.compare = zend_objects_not_comparable;
11271129

11281130
php_openssl_pkey_ce = register_class_OpenSSLAsymmetricKey();
11291131
php_openssl_pkey_ce->create_object = php_openssl_pkey_create_object;
@@ -1135,6 +1137,7 @@ PHP_MINIT_FUNCTION(openssl)
11351137
php_openssl_pkey_object_handlers.free_obj = php_openssl_pkey_free_obj;
11361138
php_openssl_pkey_object_handlers.get_constructor = php_openssl_pkey_get_constructor;
11371139
php_openssl_pkey_object_handlers.clone_obj = NULL;
1140+
php_openssl_pkey_object_handlers.compare = zend_objects_not_comparable;
11381141

11391142
#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined (LIBRESSL_VERSION_NUMBER)
11401143
OPENSSL_config(NULL);

Diff for: ext/shmop/shmop.c

+1
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ PHP_MINIT_FUNCTION(shmop)
118118
shmop_object_handlers.free_obj = shmop_free_obj;
119119
shmop_object_handlers.get_constructor = shmop_get_constructor;
120120
shmop_object_handlers.clone_obj = NULL;
121+
shmop_object_handlers.compare = zend_objects_not_comparable;
121122

122123
return SUCCESS;
123124
}

Diff for: ext/sockets/sockets.c

+1
Original file line numberDiff line numberDiff line change
@@ -455,6 +455,7 @@ static PHP_MINIT_FUNCTION(sockets)
455455
address_info_object_handlers.free_obj = address_info_free_obj;
456456
address_info_object_handlers.get_constructor = address_info_get_constructor;
457457
address_info_object_handlers.clone_obj = NULL;
458+
address_info_object_handlers.compare = zend_objects_not_comparable;
458459

459460
REGISTER_LONG_CONSTANT("AF_UNIX", AF_UNIX, CONST_CS | CONST_PERSISTENT);
460461
REGISTER_LONG_CONSTANT("AF_INET", AF_INET, CONST_CS | CONST_PERSISTENT);

Diff for: ext/sysvmsg/sysvmsg.c

+1
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ PHP_MINIT_FUNCTION(sysvmsg)
118118
sysvmsg_queue_object_handlers.free_obj = sysvmsg_queue_free_obj;
119119
sysvmsg_queue_object_handlers.get_constructor = sysvmsg_queue_get_constructor;
120120
sysvmsg_queue_object_handlers.clone_obj = NULL;
121+
sysvmsg_queue_object_handlers.compare = zend_objects_not_comparable;
121122

122123
REGISTER_LONG_CONSTANT("MSG_IPC_NOWAIT", PHP_MSG_IPC_NOWAIT, CONST_PERSISTENT|CONST_CS);
123124
REGISTER_LONG_CONSTANT("MSG_EAGAIN", EAGAIN, CONST_PERSISTENT|CONST_CS);

Diff for: ext/sysvsem/sysvsem.c

+1
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ PHP_MINIT_FUNCTION(sysvsem)
161161
sysvsem_object_handlers.free_obj = sysvsem_free_obj;
162162
sysvsem_object_handlers.get_constructor = sysvsem_get_constructor;
163163
sysvsem_object_handlers.clone_obj = NULL;
164+
sysvsem_object_handlers.compare = zend_objects_not_comparable;
164165

165166
return SUCCESS;
166167
}

Diff for: ext/sysvshm/sysvshm.c

+1
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ PHP_MINIT_FUNCTION(sysvshm)
109109
sysvshm_object_handlers.free_obj = sysvshm_free_obj;
110110
sysvshm_object_handlers.get_constructor = sysvshm_get_constructor;
111111
sysvshm_object_handlers.clone_obj = NULL;
112+
sysvshm_object_handlers.compare = zend_objects_not_comparable;
112113

113114
if (cfg_get_long("sysvshm.init_mem", &php_sysvshm.init_mem) == FAILURE) {
114115
php_sysvshm.init_mem=10000;

Diff for: ext/xml/xml.c

+1
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,7 @@ PHP_MINIT_FUNCTION(xml)
264264
xml_parser_object_handlers.get_gc = xml_parser_get_gc;
265265
xml_parser_object_handlers.get_constructor = xml_parser_get_constructor;
266266
xml_parser_object_handlers.clone_obj = NULL;
267+
xml_parser_object_handlers.compare = zend_objects_not_comparable;
267268

268269
REGISTER_LONG_CONSTANT("XML_ERROR_NONE", XML_ERROR_NONE, CONST_CS|CONST_PERSISTENT);
269270
REGISTER_LONG_CONSTANT("XML_ERROR_NO_MEMORY", XML_ERROR_NO_MEMORY, CONST_CS|CONST_PERSISTENT);

Diff for: ext/zlib/zlib.c

+2
Original file line numberDiff line numberDiff line change
@@ -1350,6 +1350,7 @@ static PHP_MINIT_FUNCTION(zlib)
13501350
inflate_context_object_handlers.free_obj = inflate_context_free_obj;
13511351
inflate_context_object_handlers.get_constructor = inflate_context_get_constructor;
13521352
inflate_context_object_handlers.clone_obj = NULL;
1353+
inflate_context_object_handlers.compare = zend_objects_not_comparable;
13531354

13541355
zend_class_entry deflate_ce;
13551356
INIT_CLASS_ENTRY(deflate_ce, "DeflateContext", class_DeflateContext_methods);
@@ -1364,6 +1365,7 @@ static PHP_MINIT_FUNCTION(zlib)
13641365
deflate_context_object_handlers.free_obj = deflate_context_free_obj;
13651366
deflate_context_object_handlers.get_constructor = deflate_context_get_constructor;
13661367
deflate_context_object_handlers.clone_obj = NULL;
1368+
deflate_context_object_handlers.compare = zend_objects_not_comparable;
13671369

13681370
REGISTER_LONG_CONSTANT("FORCE_GZIP", PHP_ZLIB_ENCODING_GZIP, CONST_CS|CONST_PERSISTENT);
13691371
REGISTER_LONG_CONSTANT("FORCE_DEFLATE", PHP_ZLIB_ENCODING_DEFLATE, CONST_CS|CONST_PERSISTENT);

0 commit comments

Comments
 (0)