summaryrefslogtreecommitdiffstats
path: root/swoole-php81.patch
blob: 7e7d1bf6cbd898995fae3e209fd497990012ac90 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
From e52686db285ea506c90a5af4f38664b5b4027a8e Mon Sep 17 00:00:00 2001
From: Remi Collet <remi@remirepo.net>
Date: Fri, 23 Jul 2021 12:43:52 +0200
Subject: [PATCH] Fix not serializable classes for 8.1.0beta1

---
 ext-src/php_swoole_private.h          | 11 ++++++++---
 ext-src/swoole_atomic.cc              |  4 ++--
 ext-src/swoole_channel_coro.cc        |  2 +-
 ext-src/swoole_client.cc              |  2 +-
 ext-src/swoole_client_coro.cc         |  2 +-
 ext-src/swoole_coroutine_scheduler.cc |  2 +-
 ext-src/swoole_http2_client_coro.cc   |  6 +++---
 ext-src/swoole_http_client_coro.cc    |  2 +-
 ext-src/swoole_http_request.cc        |  2 +-
 ext-src/swoole_http_response.cc       |  2 +-
 ext-src/swoole_http_server.cc         |  2 +-
 ext-src/swoole_http_server_coro.cc    |  2 +-
 ext-src/swoole_lock.cc                |  2 +-
 ext-src/swoole_mysql_coro.cc          |  6 +++---
 ext-src/swoole_process.cc             |  2 +-
 ext-src/swoole_process_pool.cc        |  2 +-
 ext-src/swoole_redis_coro.cc          |  2 +-
 ext-src/swoole_redis_server.cc        |  2 +-
 ext-src/swoole_server.cc              |  6 +++---
 ext-src/swoole_server_port.cc         |  2 +-
 ext-src/swoole_socket_coro.cc         |  2 +-
 ext-src/swoole_table.cc               |  2 +-
 ext-src/swoole_websocket_server.cc    |  2 +-
 thirdparty/php/curl/interface.cc      |  2 +-
 thirdparty/php/curl/multi.cc          |  4 ++--
 25 files changed, 40 insertions(+), 35 deletions(-)

diff --git a/ext-src/php_swoole_private.h b/ext-src/php_swoole_private.h
index c6af140254..b16ec0fb21 100644
--- a/ext-src/php_swoole_private.h
+++ b/ext-src/php_swoole_private.h
@@ -634,9 +634,14 @@ static sw_inline void add_assoc_ulong_safe(zval *arg, const char *key, zend_ulon
         }                                                                                                              \
     } while (0)
 
-#define SW_SET_CLASS_SERIALIZABLE(module, _serialize, _unserialize)                                                    \
-    module##_ce->serialize = _serialize;                                                                               \
-    module##_ce->unserialize = _unserialize
+#if PHP_VERSION_ID < 80100
+#define SW_SET_CLASS_NOT_SERIALIZABLE(module)                                                                          \
+    module##_ce->serialize = zend_class_serialize_deny;                                                                               \
+    module##_ce->unserialize = zend_class_unserialize_deny;
+#else
+#define SW_SET_CLASS_NOT_SERIALIZABLE(module)                                                                          \
+    module##_ce->ce_flags |= ZEND_ACC_NOT_SERIALIZABLE;
+#endif
 
 #define sw_zend_class_clone_deny NULL
 #define SW_SET_CLASS_CLONEABLE(module, _clone_obj) module##_handlers.clone_obj = _clone_obj
diff --git a/ext-src/swoole_atomic.cc b/ext-src/swoole_atomic.cc
index ad6be3ec38..54bcf1f43c 100644
--- a/ext-src/swoole_atomic.cc
+++ b/ext-src/swoole_atomic.cc
@@ -244,7 +244,7 @@ static const zend_function_entry swoole_atomic_long_methods[] =
 
 void php_swoole_atomic_minit(int module_number) {
     SW_INIT_CLASS_ENTRY(swoole_atomic, "Swoole\\Atomic", "swoole_atomic", nullptr, swoole_atomic_methods);
-    SW_SET_CLASS_SERIALIZABLE(swoole_atomic, zend_class_serialize_deny, zend_class_unserialize_deny);
+    SW_SET_CLASS_NOT_SERIALIZABLE(swoole_atomic);
     SW_SET_CLASS_CLONEABLE(swoole_atomic, sw_zend_class_clone_deny);
     SW_SET_CLASS_UNSET_PROPERTY_HANDLER(swoole_atomic, sw_zend_class_unset_property_deny);
     SW_SET_CLASS_CUSTOM_OBJECT(
@@ -252,7 +252,7 @@ void php_swoole_atomic_minit(int module_number) {
 
     SW_INIT_CLASS_ENTRY(
         swoole_atomic_long, "Swoole\\Atomic\\Long", "swoole_atomic_long", nullptr, swoole_atomic_long_methods);
-    SW_SET_CLASS_SERIALIZABLE(swoole_atomic_long, zend_class_serialize_deny, zend_class_unserialize_deny);
+    SW_SET_CLASS_NOT_SERIALIZABLE(swoole_atomic_long);
     SW_SET_CLASS_CLONEABLE(swoole_atomic_long, sw_zend_class_clone_deny);
     SW_SET_CLASS_UNSET_PROPERTY_HANDLER(swoole_atomic_long, sw_zend_class_unset_property_deny);
     SW_SET_CLASS_CUSTOM_OBJECT(swoole_atomic_long,
diff --git a/ext-src/swoole_channel_coro.cc b/ext-src/swoole_channel_coro.cc
index 8c5ebee4c2..28f7165aad 100644
--- a/ext-src/swoole_channel_coro.cc
+++ b/ext-src/swoole_channel_coro.cc
@@ -120,7 +120,7 @@ static zend_object *php_swoole_channel_coro_create_object(zend_class_entry *ce)
 void php_swoole_channel_coro_minit(int module_number) {
     SW_INIT_CLASS_ENTRY(
         swoole_channel_coro, "Swoole\\Coroutine\\Channel", nullptr, "Co\\Channel", swoole_channel_coro_methods);
-    SW_SET_CLASS_SERIALIZABLE(swoole_channel_coro, zend_class_serialize_deny, zend_class_unserialize_deny);
+    SW_SET_CLASS_NOT_SERIALIZABLE(swoole_channel_coro);
     SW_SET_CLASS_CLONEABLE(swoole_channel_coro, sw_zend_class_clone_deny);
     SW_SET_CLASS_UNSET_PROPERTY_HANDLER(swoole_channel_coro, sw_zend_class_unset_property_deny);
     SW_SET_CLASS_CUSTOM_OBJECT(swoole_channel_coro,
diff --git a/ext-src/swoole_client.cc b/ext-src/swoole_client.cc
index 21e8e7c4ff..ff414733b8 100644
--- a/ext-src/swoole_client.cc
+++ b/ext-src/swoole_client.cc
@@ -240,7 +240,7 @@ static const zend_function_entry swoole_client_methods[] =
 
 void php_swoole_client_minit(int module_number) {
     SW_INIT_CLASS_ENTRY(swoole_client, "Swoole\\Client", "swoole_client", nullptr, swoole_client_methods);
-    SW_SET_CLASS_SERIALIZABLE(swoole_client, zend_class_serialize_deny, zend_class_unserialize_deny);
+    SW_SET_CLASS_NOT_SERIALIZABLE(swoole_client);
     SW_SET_CLASS_CLONEABLE(swoole_client, sw_zend_class_clone_deny);
     SW_SET_CLASS_UNSET_PROPERTY_HANDLER(swoole_client, sw_zend_class_unset_property_deny);
     SW_SET_CLASS_CUSTOM_OBJECT(
diff --git a/ext-src/swoole_client_coro.cc b/ext-src/swoole_client_coro.cc
index 45746a42bc..312cda9f17 100644
--- a/ext-src/swoole_client_coro.cc
+++ b/ext-src/swoole_client_coro.cc
@@ -169,7 +169,7 @@ static zend_object *php_swoole_client_coro_create_object(zend_class_entry *ce) {
 void php_swoole_client_coro_minit(int module_number) {
     SW_INIT_CLASS_ENTRY(
         swoole_client_coro, "Swoole\\Coroutine\\Client", nullptr, "Co\\Client", swoole_client_coro_methods);
-    SW_SET_CLASS_SERIALIZABLE(swoole_client_coro, zend_class_serialize_deny, zend_class_unserialize_deny);
+    SW_SET_CLASS_NOT_SERIALIZABLE(swoole_client_coro);
     SW_SET_CLASS_CLONEABLE(swoole_client_coro, sw_zend_class_clone_deny);
     SW_SET_CLASS_UNSET_PROPERTY_HANDLER(swoole_client_coro, sw_zend_class_unset_property_deny);
     SW_SET_CLASS_CUSTOM_OBJECT(
diff --git a/ext-src/swoole_coroutine_scheduler.cc b/ext-src/swoole_coroutine_scheduler.cc
index e39a9cf74f..f735fce1b8 100644
--- a/ext-src/swoole_coroutine_scheduler.cc
+++ b/ext-src/swoole_coroutine_scheduler.cc
@@ -111,7 +111,7 @@ void php_swoole_coroutine_scheduler_minit(int module_number) {
                         nullptr,
                         "Co\\Scheduler",
                         swoole_coroutine_scheduler_methods);
-    SW_SET_CLASS_SERIALIZABLE(swoole_coroutine_scheduler, zend_class_serialize_deny, zend_class_unserialize_deny);
+    SW_SET_CLASS_NOT_SERIALIZABLE(swoole_coroutine_scheduler);
     SW_SET_CLASS_CLONEABLE(swoole_coroutine_scheduler, sw_zend_class_clone_deny);
     SW_SET_CLASS_UNSET_PROPERTY_HANDLER(swoole_coroutine_scheduler, sw_zend_class_unset_property_deny);
     SW_SET_CLASS_CREATE_WITH_ITS_OWN_HANDLERS(swoole_coroutine_scheduler);
diff --git a/ext-src/swoole_http2_client_coro.cc b/ext-src/swoole_http2_client_coro.cc
index 8417c729ee..7a3b3dc934 100644
--- a/ext-src/swoole_http2_client_coro.cc
+++ b/ext-src/swoole_http2_client_coro.cc
@@ -317,7 +317,7 @@ void php_swoole_http2_client_coro_minit(int module_number) {
                         nullptr,
                         "Co\\Http2\\Client",
                         swoole_http2_client_methods);
-    SW_SET_CLASS_SERIALIZABLE(swoole_http2_client_coro, zend_class_serialize_deny, zend_class_unserialize_deny);
+    SW_SET_CLASS_NOT_SERIALIZABLE(swoole_http2_client_coro);
     SW_SET_CLASS_CLONEABLE(swoole_http2_client_coro, sw_zend_class_clone_deny);
     SW_SET_CLASS_UNSET_PROPERTY_HANDLER(swoole_http2_client_coro, sw_zend_class_unset_property_deny);
     SW_SET_CLASS_CUSTOM_OBJECT(swoole_http2_client_coro,
@@ -334,13 +334,13 @@ void php_swoole_http2_client_coro_minit(int module_number) {
                            swoole_exception);
 
     SW_INIT_CLASS_ENTRY(swoole_http2_request, "Swoole\\Http2\\Request", "swoole_http2_request", nullptr, nullptr);
-    SW_SET_CLASS_SERIALIZABLE(swoole_http2_request, zend_class_serialize_deny, zend_class_unserialize_deny);
+    SW_SET_CLASS_NOT_SERIALIZABLE(swoole_http2_request);
     SW_SET_CLASS_CLONEABLE(swoole_http2_request, sw_zend_class_clone_deny);
     SW_SET_CLASS_UNSET_PROPERTY_HANDLER(swoole_http2_request, sw_zend_class_unset_property_deny);
     SW_SET_CLASS_CREATE_WITH_ITS_OWN_HANDLERS(swoole_http2_request);
 
     SW_INIT_CLASS_ENTRY(swoole_http2_response, "Swoole\\Http2\\Response", "swoole_http2_response", nullptr, nullptr);
-    SW_SET_CLASS_SERIALIZABLE(swoole_http2_response, zend_class_serialize_deny, zend_class_unserialize_deny);
+    SW_SET_CLASS_NOT_SERIALIZABLE(swoole_http2_response);
     SW_SET_CLASS_CLONEABLE(swoole_http2_response, sw_zend_class_clone_deny);
     SW_SET_CLASS_UNSET_PROPERTY_HANDLER(swoole_http2_response, sw_zend_class_unset_property_deny);
     SW_SET_CLASS_CREATE_WITH_ITS_OWN_HANDLERS(swoole_http2_response);
diff --git a/ext-src/swoole_http_client_coro.cc b/ext-src/swoole_http_client_coro.cc
index 34c2bfcca9..cf7c7fa825 100644
--- a/ext-src/swoole_http_client_coro.cc
+++ b/ext-src/swoole_http_client_coro.cc
@@ -1712,7 +1712,7 @@ void php_swoole_http_client_coro_minit(int module_number) {
                         nullptr,
                         "Co\\Http\\Client",
                         swoole_http_client_coro_methods);
-    SW_SET_CLASS_SERIALIZABLE(swoole_http_client_coro, zend_class_serialize_deny, zend_class_unserialize_deny);
+    SW_SET_CLASS_NOT_SERIALIZABLE(swoole_http_client_coro);
     SW_SET_CLASS_CLONEABLE(swoole_http_client_coro, sw_zend_class_clone_deny);
     SW_SET_CLASS_UNSET_PROPERTY_HANDLER(swoole_http_client_coro, sw_zend_class_unset_property_deny);
     SW_SET_CLASS_CUSTOM_OBJECT(swoole_http_client_coro,
diff --git a/ext-src/swoole_http_request.cc b/ext-src/swoole_http_request.cc
index 4f4ca4e3f6..218bfcc175 100644
--- a/ext-src/swoole_http_request.cc
+++ b/ext-src/swoole_http_request.cc
@@ -225,7 +225,7 @@ const zend_function_entry swoole_http_request_methods[] =
 void php_swoole_http_request_minit(int module_number) {
     SW_INIT_CLASS_ENTRY(
         swoole_http_request, "Swoole\\Http\\Request", "swoole_http_request", nullptr, swoole_http_request_methods);
-    SW_SET_CLASS_SERIALIZABLE(swoole_http_request, zend_class_serialize_deny, zend_class_unserialize_deny);
+    SW_SET_CLASS_NOT_SERIALIZABLE(swoole_http_request);
     SW_SET_CLASS_CLONEABLE(swoole_http_request, sw_zend_class_clone_deny);
     SW_SET_CLASS_UNSET_PROPERTY_HANDLER(swoole_http_request, sw_zend_class_unset_property_deny);
     SW_SET_CLASS_CUSTOM_OBJECT(swoole_http_request,
diff --git a/ext-src/swoole_http_response.cc b/ext-src/swoole_http_response.cc
index f8edb299b2..a908e5d4f3 100644
--- a/ext-src/swoole_http_response.cc
+++ b/ext-src/swoole_http_response.cc
@@ -263,7 +263,7 @@ const zend_function_entry swoole_http_response_methods[] =
 void php_swoole_http_response_minit(int module_number) {
     SW_INIT_CLASS_ENTRY(
         swoole_http_response, "Swoole\\Http\\Response", "swoole_http_response", nullptr, swoole_http_response_methods);
-    SW_SET_CLASS_SERIALIZABLE(swoole_http_response, zend_class_serialize_deny, zend_class_unserialize_deny);
+    SW_SET_CLASS_NOT_SERIALIZABLE(swoole_http_response);
     SW_SET_CLASS_CLONEABLE(swoole_http_response, sw_zend_class_clone_deny);
     SW_SET_CLASS_UNSET_PROPERTY_HANDLER(swoole_http_response, sw_zend_class_unset_property_deny);
     SW_SET_CLASS_CUSTOM_OBJECT(swoole_http_response,
diff --git a/ext-src/swoole_http_server.cc b/ext-src/swoole_http_server.cc
index 0d71470e92..730667782d 100644
--- a/ext-src/swoole_http_server.cc
+++ b/ext-src/swoole_http_server.cc
@@ -147,7 +147,7 @@ int php_swoole_http_server_onReceive(Server *serv, RecvData *req) {
 void php_swoole_http_server_minit(int module_number) {
     SW_INIT_CLASS_ENTRY_EX(
         swoole_http_server, "Swoole\\Http\\Server", "swoole_http_server", nullptr, nullptr, swoole_server);
-    SW_SET_CLASS_SERIALIZABLE(swoole_http_server, zend_class_serialize_deny, zend_class_unserialize_deny);
+    SW_SET_CLASS_NOT_SERIALIZABLE(swoole_http_server);
     SW_SET_CLASS_CLONEABLE(swoole_http_server, sw_zend_class_clone_deny);
     SW_SET_CLASS_UNSET_PROPERTY_HANDLER(swoole_http_server, sw_zend_class_unset_property_deny);
 }
diff --git a/ext-src/swoole_http_server_coro.cc b/ext-src/swoole_http_server_coro.cc
index 78a6381112..7d7edf834a 100644
--- a/ext-src/swoole_http_server_coro.cc
+++ b/ext-src/swoole_http_server_coro.cc
@@ -302,7 +302,7 @@ void php_swoole_http_server_coro_minit(int module_number) {
                         nullptr,
                         "Co\\Http\\Server",
                         swoole_http_server_coro_methods);
-    SW_SET_CLASS_SERIALIZABLE(swoole_http_server_coro, zend_class_serialize_deny, zend_class_unserialize_deny);
+    SW_SET_CLASS_NOT_SERIALIZABLE(swoole_http_server_coro);
     SW_SET_CLASS_CLONEABLE(swoole_http_server_coro, sw_zend_class_clone_deny);
     SW_SET_CLASS_UNSET_PROPERTY_HANDLER(swoole_http_server_coro, sw_zend_class_unset_property_deny);
     SW_SET_CLASS_CREATE_WITH_ITS_OWN_HANDLERS(swoole_http_server_coro);
diff --git a/ext-src/swoole_lock.cc b/ext-src/swoole_lock.cc
index 3420dda1de..075f624c89 100644
--- a/ext-src/swoole_lock.cc
+++ b/ext-src/swoole_lock.cc
@@ -113,7 +113,7 @@ static const zend_function_entry swoole_lock_methods[] =
 
 void php_swoole_lock_minit(int module_number) {
     SW_INIT_CLASS_ENTRY(swoole_lock, "Swoole\\Lock", "swoole_lock", nullptr, swoole_lock_methods);
-    SW_SET_CLASS_SERIALIZABLE(swoole_lock, zend_class_serialize_deny, zend_class_unserialize_deny);
+    SW_SET_CLASS_NOT_SERIALIZABLE(swoole_lock);
     SW_SET_CLASS_CLONEABLE(swoole_lock, sw_zend_class_clone_deny);
     SW_SET_CLASS_UNSET_PROPERTY_HANDLER(swoole_lock, sw_zend_class_unset_property_deny);
     SW_SET_CLASS_CUSTOM_OBJECT(
diff --git a/ext-src/swoole_mysql_coro.cc b/ext-src/swoole_mysql_coro.cc
index ff1b115948..574e9c028b 100644
--- a/ext-src/swoole_mysql_coro.cc
+++ b/ext-src/swoole_mysql_coro.cc
@@ -1690,7 +1690,7 @@ static sw_inline void swoole_mysql_coro_sync_execute_result_properties(zval *zob
 
 void php_swoole_mysql_coro_minit(int module_number) {
     SW_INIT_CLASS_ENTRY(swoole_mysql_coro, "Swoole\\Coroutine\\MySQL", nullptr, "Co\\MySQL", swoole_mysql_coro_methods);
-    SW_SET_CLASS_SERIALIZABLE(swoole_mysql_coro, zend_class_serialize_deny, zend_class_unserialize_deny);
+    SW_SET_CLASS_NOT_SERIALIZABLE(swoole_mysql_coro);
     SW_SET_CLASS_CLONEABLE(swoole_mysql_coro, sw_zend_class_clone_deny);
     SW_SET_CLASS_UNSET_PROPERTY_HANDLER(swoole_mysql_coro, sw_zend_class_unset_property_deny);
     SW_SET_CLASS_CUSTOM_OBJECT(
@@ -1701,7 +1701,7 @@ void php_swoole_mysql_coro_minit(int module_number) {
                         nullptr,
                         "Co\\MySQL\\Statement",
                         swoole_mysql_coro_statement_methods);
-    SW_SET_CLASS_SERIALIZABLE(swoole_mysql_coro_statement, zend_class_serialize_deny, zend_class_unserialize_deny);
+    SW_SET_CLASS_NOT_SERIALIZABLE(swoole_mysql_coro_statement);
     SW_SET_CLASS_CLONEABLE(swoole_mysql_coro_statement, sw_zend_class_clone_deny);
     SW_SET_CLASS_UNSET_PROPERTY_HANDLER(swoole_mysql_coro_statement, sw_zend_class_unset_property_deny);
     SW_SET_CLASS_CUSTOM_OBJECT(swoole_mysql_coro_statement,
@@ -1716,7 +1716,7 @@ void php_swoole_mysql_coro_minit(int module_number) {
                            "Co\\MySQL\\Exception",
                            nullptr,
                            swoole_exception);
-    SW_SET_CLASS_SERIALIZABLE(swoole_mysql_coro_exception, zend_class_serialize_deny, zend_class_unserialize_deny);
+    SW_SET_CLASS_NOT_SERIALIZABLE(swoole_mysql_coro_exception);
     SW_SET_CLASS_CLONEABLE(swoole_mysql_coro_exception, sw_zend_class_clone_deny);
     SW_SET_CLASS_UNSET_PROPERTY_HANDLER(swoole_mysql_coro_exception, sw_zend_class_unset_property_deny);
     SW_SET_CLASS_CREATE_WITH_ITS_OWN_HANDLERS(swoole_mysql_coro_exception);
diff --git a/ext-src/swoole_process.cc b/ext-src/swoole_process.cc
index 91ee369517..46a8298ebc 100644
--- a/ext-src/swoole_process.cc
+++ b/ext-src/swoole_process.cc
@@ -258,7 +258,7 @@ static const zend_function_entry swoole_process_methods[] =
 
 void php_swoole_process_minit(int module_number) {
     SW_INIT_CLASS_ENTRY(swoole_process, "Swoole\\Process", "swoole_process", nullptr, swoole_process_methods);
-    SW_SET_CLASS_SERIALIZABLE(swoole_process, zend_class_serialize_deny, zend_class_unserialize_deny);
+    SW_SET_CLASS_NOT_SERIALIZABLE(swoole_process);
     SW_SET_CLASS_CLONEABLE(swoole_process, sw_zend_class_clone_deny);
     SW_SET_CLASS_UNSET_PROPERTY_HANDLER(swoole_process, sw_zend_class_unset_property_deny);
     SW_SET_CLASS_CUSTOM_OBJECT(
diff --git a/ext-src/swoole_process_pool.cc b/ext-src/swoole_process_pool.cc
index eda655823c..c13a7d3ad6 100644
--- a/ext-src/swoole_process_pool.cc
+++ b/ext-src/swoole_process_pool.cc
@@ -189,7 +189,7 @@ static const zend_function_entry swoole_process_pool_methods[] =
 void php_swoole_process_pool_minit(int module_number) {
     SW_INIT_CLASS_ENTRY(
         swoole_process_pool, "Swoole\\Process\\Pool", "swoole_process_pool", nullptr, swoole_process_pool_methods);
-    SW_SET_CLASS_SERIALIZABLE(swoole_process_pool, zend_class_serialize_deny, zend_class_unserialize_deny);
+    SW_SET_CLASS_NOT_SERIALIZABLE(swoole_process_pool);
     SW_SET_CLASS_CLONEABLE(swoole_process_pool, sw_zend_class_clone_deny);
     SW_SET_CLASS_UNSET_PROPERTY_HANDLER(swoole_process_pool, sw_zend_class_unset_property_deny);
     SW_SET_CLASS_CUSTOM_OBJECT(swoole_process_pool,
diff --git a/ext-src/swoole_redis_coro.cc b/ext-src/swoole_redis_coro.cc
index 174201246c..343dad1053 100644
--- a/ext-src/swoole_redis_coro.cc
+++ b/ext-src/swoole_redis_coro.cc
@@ -1895,7 +1895,7 @@ static const zend_function_entry swoole_redis_coro_methods[] =
 
 void php_swoole_redis_coro_minit(int module_number) {
     SW_INIT_CLASS_ENTRY(swoole_redis_coro, "Swoole\\Coroutine\\Redis", nullptr, "Co\\Redis", swoole_redis_coro_methods);
-    SW_SET_CLASS_SERIALIZABLE(swoole_redis_coro, zend_class_serialize_deny, zend_class_unserialize_deny);
+    SW_SET_CLASS_NOT_SERIALIZABLE(swoole_redis_coro);
     SW_SET_CLASS_CLONEABLE(swoole_redis_coro, sw_zend_class_clone_deny);
     SW_SET_CLASS_UNSET_PROPERTY_HANDLER(swoole_redis_coro, sw_zend_class_unset_property_deny);
     SW_SET_CLASS_CREATE_WITH_ITS_OWN_HANDLERS(swoole_redis_coro);
diff --git a/ext-src/swoole_redis_server.cc b/ext-src/swoole_redis_server.cc
index eb144ef948..69f1dd1e06 100644
--- a/ext-src/swoole_redis_server.cc
+++ b/ext-src/swoole_redis_server.cc
@@ -71,7 +71,7 @@ void php_swoole_redis_server_minit(int module_number) {
                            nullptr,
                            swoole_redis_server_methods,
                            swoole_server);
-    SW_SET_CLASS_SERIALIZABLE(swoole_redis_server, zend_class_serialize_deny, zend_class_unserialize_deny);
+    SW_SET_CLASS_NOT_SERIALIZABLE(swoole_redis_server);
     SW_SET_CLASS_CLONEABLE(swoole_redis_server, sw_zend_class_clone_deny);
     SW_SET_CLASS_UNSET_PROPERTY_HANDLER(swoole_redis_server, sw_zend_class_unset_property_deny);
 
diff --git a/ext-src/swoole_server.cc b/ext-src/swoole_server.cc
index 3824e860e4..3ab5a037bd 100644
--- a/ext-src/swoole_server.cc
+++ b/ext-src/swoole_server.cc
@@ -608,7 +608,7 @@ static const zend_function_entry swoole_server_task_methods[] =
 void php_swoole_server_minit(int module_number) {
     // ---------------------------------------Server-------------------------------------
     SW_INIT_CLASS_ENTRY(swoole_server, "Swoole\\Server", "swoole_server", nullptr, swoole_server_methods);
-    SW_SET_CLASS_SERIALIZABLE(swoole_server, zend_class_serialize_deny, zend_class_unserialize_deny);
+    SW_SET_CLASS_NOT_SERIALIZABLE(swoole_server);
     SW_SET_CLASS_CLONEABLE(swoole_server, sw_zend_class_clone_deny);
     SW_SET_CLASS_UNSET_PROPERTY_HANDLER(swoole_server, sw_zend_class_unset_property_deny);
     SW_SET_CLASS_CUSTOM_OBJECT(swoole_server, server_create_object, server_free_object, ServerObject, std);
@@ -623,7 +623,7 @@ void php_swoole_server_minit(int module_number) {
     SW_INIT_CLASS_ENTRY(
         swoole_server_task, "Swoole\\Server\\Task", "swoole_server_task", nullptr, swoole_server_task_methods);
     swoole_server_task_ce->ce_flags |= ZEND_ACC_FINAL;
-    SW_SET_CLASS_SERIALIZABLE(swoole_server_task, zend_class_serialize_deny, zend_class_unserialize_deny);
+    SW_SET_CLASS_NOT_SERIALIZABLE(swoole_server_task);
     SW_SET_CLASS_CLONEABLE(swoole_server_task, sw_zend_class_clone_deny);
     SW_SET_CLASS_UNSET_PROPERTY_HANDLER(swoole_server_task, sw_zend_class_unset_property_deny);
     SW_SET_CLASS_CUSTOM_OBJECT(swoole_server_task,
@@ -673,7 +673,7 @@ void php_swoole_server_minit(int module_number) {
                         "swoole_connection_iterator",
                         nullptr,
                         swoole_connection_iterator_methods);
-    SW_SET_CLASS_SERIALIZABLE(swoole_connection_iterator, zend_class_serialize_deny, zend_class_unserialize_deny);
+    SW_SET_CLASS_NOT_SERIALIZABLE(swoole_connection_iterator);
     SW_SET_CLASS_CLONEABLE(swoole_connection_iterator, sw_zend_class_clone_deny);
     SW_SET_CLASS_UNSET_PROPERTY_HANDLER(swoole_connection_iterator, sw_zend_class_unset_property_deny);
     SW_SET_CLASS_CUSTOM_OBJECT(swoole_connection_iterator,
diff --git a/ext-src/swoole_server_port.cc b/ext-src/swoole_server_port.cc
index d657150ac9..b22ab7847f 100644
--- a/ext-src/swoole_server_port.cc
+++ b/ext-src/swoole_server_port.cc
@@ -166,7 +166,7 @@ const zend_function_entry swoole_server_port_methods[] =
 void php_swoole_server_port_minit(int module_number) {
     SW_INIT_CLASS_ENTRY(
         swoole_server_port, "Swoole\\Server\\Port", "swoole_server_port", nullptr, swoole_server_port_methods);
-    SW_SET_CLASS_SERIALIZABLE(swoole_server_port, zend_class_serialize_deny, zend_class_unserialize_deny);
+    SW_SET_CLASS_NOT_SERIALIZABLE(swoole_server_port);
     SW_SET_CLASS_CLONEABLE(swoole_server_port, sw_zend_class_clone_deny);
     SW_SET_CLASS_UNSET_PROPERTY_HANDLER(swoole_server_port, sw_zend_class_unset_property_deny);
     SW_SET_CLASS_CUSTOM_OBJECT(swoole_server_port,
diff --git a/ext-src/swoole_socket_coro.cc b/ext-src/swoole_socket_coro.cc
index 4054781e80..e3799f4566 100644
--- a/ext-src/swoole_socket_coro.cc
+++ b/ext-src/swoole_socket_coro.cc
@@ -803,7 +803,7 @@ static void swoole_socket_coro_register_constants(int module_number) {
 void php_swoole_socket_coro_minit(int module_number) {
     SW_INIT_CLASS_ENTRY(
         swoole_socket_coro, "Swoole\\Coroutine\\Socket", nullptr, "Co\\Socket", swoole_socket_coro_methods);
-    SW_SET_CLASS_SERIALIZABLE(swoole_socket_coro, zend_class_serialize_deny, zend_class_unserialize_deny);
+    SW_SET_CLASS_NOT_SERIALIZABLE(swoole_socket_coro);
     SW_SET_CLASS_CLONEABLE(swoole_socket_coro, sw_zend_class_clone_deny);
     SW_SET_CLASS_UNSET_PROPERTY_HANDLER(swoole_socket_coro, sw_zend_class_unset_property_deny);
     SW_SET_CLASS_CUSTOM_OBJECT(swoole_socket_coro,
diff --git a/ext-src/swoole_table.cc b/ext-src/swoole_table.cc
index eb3949594c..9effa63828 100644
--- a/ext-src/swoole_table.cc
+++ b/ext-src/swoole_table.cc
@@ -220,7 +220,7 @@ static const zend_function_entry swoole_table_methods[] =
 
 void php_swoole_table_minit(int module_number) {
     SW_INIT_CLASS_ENTRY(swoole_table, "Swoole\\Table", "swoole_table", nullptr, swoole_table_methods);
-    SW_SET_CLASS_SERIALIZABLE(swoole_table, zend_class_serialize_deny, zend_class_unserialize_deny);
+    SW_SET_CLASS_NOT_SERIALIZABLE(swoole_table);
     SW_SET_CLASS_CLONEABLE(swoole_table, sw_zend_class_clone_deny);
     SW_SET_CLASS_UNSET_PROPERTY_HANDLER(swoole_table, sw_zend_class_unset_property_deny);
     SW_SET_CLASS_CUSTOM_OBJECT(
diff --git a/ext-src/swoole_websocket_server.cc b/ext-src/swoole_websocket_server.cc
index 55435e9334..6cf7671631 100644
--- a/ext-src/swoole_websocket_server.cc
+++ b/ext-src/swoole_websocket_server.cc
@@ -628,7 +628,7 @@ void php_swoole_websocket_server_minit(int module_number) {
                            nullptr,
                            swoole_websocket_server_methods,
                            swoole_http_server);
-    SW_SET_CLASS_SERIALIZABLE(swoole_websocket_server, zend_class_serialize_deny, zend_class_unserialize_deny);
+    SW_SET_CLASS_NOT_SERIALIZABLE(swoole_websocket_server);
     SW_SET_CLASS_CLONEABLE(swoole_websocket_server, sw_zend_class_clone_deny);
     SW_SET_CLASS_UNSET_PROPERTY_HANDLER(swoole_websocket_server, sw_zend_class_unset_property_deny);
 
diff --git a/thirdparty/php/curl/interface.cc b/thirdparty/php/curl/interface.cc
index b5817fd2d3..8db261760e 100644
--- a/thirdparty/php/curl/interface.cc
+++ b/thirdparty/php/curl/interface.cc
@@ -315,7 +315,7 @@ void swoole_native_curl_minit(int module_number) {
 #if PHP_VERSION_ID >= 80000
     SW_INIT_CLASS_ENTRY(
         swoole_coroutine_curl_handle, "Swoole\\Coroutine\\Curl\\Handle", nullptr, "Co\\Curl\\Handle", nullptr);
-    SW_SET_CLASS_SERIALIZABLE(swoole_coroutine_curl_handle, zend_class_serialize_deny, zend_class_unserialize_deny);
+    SW_SET_CLASS_NOT_SERIALIZABLE(swoole_coroutine_curl_handle);
     SW_SET_CLASS_CUSTOM_OBJECT(swoole_coroutine_curl_handle, curl_create_object, curl_free_obj, php_curl, std);
     swoole_coroutine_curl_handle_ce->ce_flags |= ZEND_ACC_FINAL | ZEND_ACC_NO_DYNAMIC_PROPERTIES;
     swoole_coroutine_curl_handle_handlers.get_gc = curl_get_gc;
diff --git a/thirdparty/php/curl/multi.cc b/thirdparty/php/curl/multi.cc
index 6561af5b98..cbca9c515b 100644
--- a/thirdparty/php/curl/multi.cc
+++ b/thirdparty/php/curl/multi.cc
@@ -694,8 +694,8 @@ void curl_multi_register_class(const zend_function_entry *method_entries) {
                         nullptr,
                         "Co\\Curl\\MultiHandle",
                         nullptr);
-    SW_SET_CLASS_SERIALIZABLE(
-        swoole_coroutine_curl_multi_handle, zend_class_serialize_deny, zend_class_unserialize_deny);
+    SW_SET_CLASS_NOT_SERIALIZABLE(
+        swoole_coroutine_curl_multi_handle);
     SW_SET_CLASS_CUSTOM_OBJECT(
         swoole_coroutine_curl_multi_handle, curl_multi_create_object, curl_multi_free_obj, php_curlm, std);
     swoole_coroutine_curl_multi_handle_ce->ce_flags |= ZEND_ACC_FINAL | ZEND_ACC_NO_DYNAMIC_PROPERTIES;