summaryrefslogtreecommitdiffstats
path: root/yaf-php81.patch
blob: 8f159749f27454bf1609062f48bc35d240decfc5 (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
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
From 36bbd32afac5c2a38ec409b33505352262acefd7 Mon Sep 17 00:00:00 2001
From: Remi Collet <remi@remirepo.net>
Date: Wed, 21 Jul 2021 08:08:39 +0200
Subject: [PATCH] fix for 8.1.0beta1 - use ZEND_ACC_NOT_SERIALIZABLE instead of
 zend_class_serialize_deny - add return type for Iterators

---
 configs/yaf_config_ini.c    | 18 ++++++++-
 configs/yaf_config_simple.c | 18 ++++++++-
 routes/yaf_route_map.c      |  4 ++
 routes/yaf_route_regex.c    |  4 ++
 routes/yaf_route_rewrite.c  |  6 ++-
 routes/yaf_route_simple.c   |  4 ++
 routes/yaf_route_supervar.c |  7 +++-
 views/yaf_view_simple.c     |  5 ++-
 yaf_application.c           |  6 ++-
 yaf_config.c                | 73 ++++++++++++++++++++++++++++++-------
 yaf_controller.c            |  7 +++-
 yaf_dispatcher.c            |  5 ++-
 yaf_loader.c                |  4 ++
 yaf_registry.c              |  4 ++
 yaf_request.c               |  7 +++-
 yaf_response.c              |  7 +++-
 yaf_router.c                |  6 ++-
 yaf_session.c               | 45 +++++++++++++++++++----
 18 files changed, 193 insertions(+), 37 deletions(-)

diff --git a/configs/yaf_config_ini.c b/configs/yaf_config_ini.c
index c94f85a8..8ede29c0 100644
--- a/configs/yaf_config_ini.c
+++ b/configs/yaf_config_ini.c
@@ -53,6 +53,20 @@ ZEND_BEGIN_ARG_INFO_EX(yaf_config_ini_set_arginfo, 0, 0, 2)
 	ZEND_ARG_INFO(0, name)
 	ZEND_ARG_INFO(0, value)
 ZEND_END_ARG_INFO()
+
+#if PHP_VERSION_ID < 80100
+#define yaf_config_ini_oget_arginfo yaf_config_ini_get_arginfo
+#define yaf_config_ini_oset_arginfo yaf_config_ini_set_arginfo
+#else
+ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(yaf_config_ini_oget_arginfo, 0, 1, IS_MIXED, 0)
+	ZEND_ARG_INFO(0, name)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(yaf_config_ini_oset_arginfo, 0, 2, IS_VOID, 0)
+	ZEND_ARG_INFO(0, name)
+	ZEND_ARG_TYPE_INFO(0, value, IS_MIXED, 0)
+ZEND_END_ARG_INFO()
+#endif
 /* }}} */
 
 static inline void yaf_deep_copy_section(zval *dst, zval *src) /* {{{ */ {
@@ -508,8 +522,8 @@ zend_function_entry yaf_config_ini_methods[] = {
 	PHP_ME(yaf_config_ini, get, yaf_config_ini_get_arginfo, ZEND_ACC_PUBLIC)
 	PHP_ME(yaf_config_ini, set, yaf_config_ini_set_arginfo, ZEND_ACC_PUBLIC)
 	PHP_ME(yaf_config_ini, readonly, yaf_config_ini_void_arginfo, ZEND_ACC_PUBLIC)
-	PHP_MALIAS(yaf_config_ini, offsetGet, get, yaf_config_ini_get_arginfo, ZEND_ACC_PUBLIC)
-	PHP_MALIAS(yaf_config_ini, offsetSet, set, yaf_config_ini_set_arginfo, ZEND_ACC_PUBLIC)
+	PHP_MALIAS(yaf_config_ini, offsetGet, get, yaf_config_ini_oget_arginfo, ZEND_ACC_PUBLIC)
+	PHP_MALIAS(yaf_config_ini, offsetSet, set, yaf_config_ini_oset_arginfo, ZEND_ACC_PUBLIC)
 	PHP_MALIAS(yaf_config_ini, __set, set, yaf_config_ini_set_arginfo, ZEND_ACC_PUBLIC)
 	{NULL, NULL, NULL}
 };
diff --git a/configs/yaf_config_simple.c b/configs/yaf_config_simple.c
index 191f356e..a6d26834 100644
--- a/configs/yaf_config_simple.c
+++ b/configs/yaf_config_simple.c
@@ -47,6 +47,20 @@ ZEND_END_ARG_INFO()
 ZEND_BEGIN_ARG_INFO_EX(yaf_config_simple_unset_arginfo, 0, 0, 1)
 	ZEND_ARG_INFO(0, name)
 ZEND_END_ARG_INFO()
+
+#if PHP_VERSION_ID < 80100
+#define yaf_config_simple_oset_arginfo   yaf_config_simple_set_arginfo
+#define yaf_config_simple_ounset_arginfo yaf_config_simple_unset_arginfo
+#else
+ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(yaf_config_simple_oset_arginfo, 0, 2, IS_VOID, 0)
+	ZEND_ARG_INFO(0, name)
+	ZEND_ARG_TYPE_INFO(0, value, IS_MIXED, 0)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(yaf_config_simple_ounset_arginfo, 0, 1, IS_VOID, 0)
+	ZEND_ARG_INFO(0, name)
+ZEND_END_ARG_INFO()
+#endif
 /* }}} */
 
 void yaf_config_simple_init(yaf_config_object *conf, zval *val, int readonly) /* {{{ */ {
@@ -158,9 +172,9 @@ zend_function_entry yaf_config_simple_methods[] = {
 	PHP_ME(yaf_config_simple,     __construct, yaf_config_simple_construct_arginfo, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR)
 	PHP_ME(yaf_config_simple,     set, yaf_config_simple_set_arginfo, ZEND_ACC_PUBLIC)
 	PHP_ME(yaf_config_simple,     readonly,	yaf_config_simple_void_arginfo, ZEND_ACC_PUBLIC)
-	PHP_ME(yaf_config_simple,     offsetUnset, yaf_config_simple_unset_arginfo, ZEND_ACC_PUBLIC)
+	PHP_ME(yaf_config_simple,     offsetUnset, yaf_config_simple_ounset_arginfo, ZEND_ACC_PUBLIC)
 	PHP_MALIAS(yaf_config_simple, __set, set, yaf_config_simple_set_arginfo, ZEND_ACC_PUBLIC)
-	PHP_MALIAS(yaf_config_simple, offsetSet, set, yaf_config_simple_set_arginfo, ZEND_ACC_PUBLIC)
+	PHP_MALIAS(yaf_config_simple, offsetSet, set, yaf_config_simple_oset_arginfo, ZEND_ACC_PUBLIC)
 	{NULL, NULL, NULL}
 };
 /* }}} */
diff --git a/routes/yaf_route_map.c b/routes/yaf_route_map.c
index 85ec4602..41a7439b 100644
--- a/routes/yaf_route_map.c
+++ b/routes/yaf_route_map.c
@@ -363,9 +363,13 @@ YAF_STARTUP_FUNCTION(route_map) {
 	YAF_INIT_CLASS_ENTRY(ce, "Yaf_Route_Map", "Yaf\\Route\\Map", yaf_route_map_methods);
 	yaf_route_map_ce = zend_register_internal_class(&ce);
 	yaf_route_map_ce->create_object = yaf_route_map_new;
+#if PHP_VERSION_ID < 80100
 	yaf_route_map_ce->ce_flags |= ZEND_ACC_FINAL;
 	yaf_route_map_ce->serialize = zend_class_serialize_deny;
 	yaf_route_map_ce->unserialize = zend_class_unserialize_deny;
+#else
+	yaf_route_map_ce->ce_flags |= ZEND_ACC_FINAL | ZEND_ACC_NOT_SERIALIZABLE;
+#endif
 
 	zend_class_implements(yaf_route_map_ce, 1, yaf_route_ce);
 
diff --git a/routes/yaf_route_regex.c b/routes/yaf_route_regex.c
index 7e2647e6..fb63a78e 100644
--- a/routes/yaf_route_regex.c
+++ b/routes/yaf_route_regex.c
@@ -466,9 +466,13 @@ YAF_STARTUP_FUNCTION(route_regex) {
 	YAF_INIT_CLASS_ENTRY(ce, "Yaf_Route_Regex", "Yaf\\Route\\Regex", yaf_route_regex_methods);
 	yaf_route_regex_ce = zend_register_internal_class(&ce);
 	yaf_route_regex_ce->create_object = yaf_route_regex_new;
+#if PHP_VERSION_ID < 80100
 	yaf_route_regex_ce->ce_flags |= ZEND_ACC_FINAL;
 	yaf_route_regex_ce->serialize = zend_class_serialize_deny;
 	yaf_route_regex_ce->unserialize = zend_class_unserialize_deny;
+#else
+	yaf_route_regex_ce->ce_flags |= ZEND_ACC_FINAL | ZEND_ACC_NOT_SERIALIZABLE;
+#endif
 
 	zend_class_implements(yaf_route_regex_ce, 1, yaf_route_ce);
 
diff --git a/routes/yaf_route_rewrite.c b/routes/yaf_route_rewrite.c
index 624e4f1b..2bac1b0b 100644
--- a/routes/yaf_route_rewrite.c
+++ b/routes/yaf_route_rewrite.c
@@ -489,10 +489,14 @@ YAF_STARTUP_FUNCTION(route_rewrite) {
 	zend_class_entry ce;
 	YAF_INIT_CLASS_ENTRY(ce, "Yaf_Route_Rewrite", "Yaf\\Route\\Rewrite", yaf_route_rewrite_methods);
 	yaf_route_rewrite_ce = zend_register_internal_class_ex(&ce, NULL);
-	yaf_route_rewrite_ce->ce_flags |= ZEND_ACC_FINAL;
 	yaf_route_rewrite_ce->create_object = yaf_route_rewrite_new;
+#if PHP_VERSION_ID < 80100
+	yaf_route_rewrite_ce->ce_flags |= ZEND_ACC_FINAL;
 	yaf_route_rewrite_ce->serialize = zend_class_serialize_deny;
 	yaf_route_rewrite_ce->unserialize = zend_class_unserialize_deny;
+#else
+	yaf_route_rewrite_ce->ce_flags |= ZEND_ACC_FINAL | ZEND_ACC_NOT_SERIALIZABLE;
+#endif
 
 	zend_class_implements(yaf_route_rewrite_ce, 1, yaf_route_ce);
 
diff --git a/routes/yaf_route_simple.c b/routes/yaf_route_simple.c
index da5498f1..f042d895 100644
--- a/routes/yaf_route_simple.c
+++ b/routes/yaf_route_simple.c
@@ -275,9 +275,13 @@ YAF_STARTUP_FUNCTION(route_simple) {
 	YAF_INIT_CLASS_ENTRY(ce, "Yaf_Route_Simple", "Yaf\\Route\\Simple", yaf_route_simple_methods);
 	yaf_route_simple_ce = zend_register_internal_class(&ce);
 	yaf_route_simple_ce->create_object = yaf_route_simple_new;
+#if PHP_VERSION_ID < 80100
 	yaf_route_simple_ce->ce_flags |= ZEND_ACC_FINAL;
 	yaf_route_simple_ce->serialize = zend_class_serialize_deny;
 	yaf_route_simple_ce->unserialize = zend_class_unserialize_deny;
+#else
+	yaf_route_simple_ce->ce_flags |= ZEND_ACC_FINAL | ZEND_ACC_NOT_SERIALIZABLE;
+#endif
 
 	zend_class_implements(yaf_route_simple_ce, 1, yaf_route_ce);
 
diff --git a/routes/yaf_route_supervar.c b/routes/yaf_route_supervar.c
index 21bff266..946a7a65 100644
--- a/routes/yaf_route_supervar.c
+++ b/routes/yaf_route_supervar.c
@@ -234,11 +234,14 @@ YAF_STARTUP_FUNCTION(route_supervar) {
 	zend_class_entry ce;
 	YAF_INIT_CLASS_ENTRY(ce, "Yaf_Route_Supervar", "Yaf\\Route\\Supervar", yaf_route_supervar_methods);
 	yaf_route_supervar_ce = zend_register_internal_class(&ce);
-	yaf_route_supervar_ce->ce_flags |= ZEND_ACC_FINAL;
-
 	yaf_route_supervar_ce->create_object = yaf_route_supervar_new;
+#if PHP_VERSION_ID < 80100
+	yaf_route_supervar_ce->ce_flags |= ZEND_ACC_FINAL;
 	yaf_route_supervar_ce->serialize = zend_class_serialize_deny;
 	yaf_route_supervar_ce->unserialize = zend_class_unserialize_deny;
+#else
+	yaf_route_supervar_ce->ce_flags |= ZEND_ACC_FINAL | ZEND_ACC_NOT_SERIALIZABLE;
+#endif
 
 	zend_class_implements(yaf_route_supervar_ce, 1, yaf_route_ce);
 
diff --git a/views/yaf_view_simple.c b/views/yaf_view_simple.c
index 12419883..4abc383a 100755
--- a/views/yaf_view_simple.c
+++ b/views/yaf_view_simple.c
@@ -673,9 +673,12 @@ YAF_STARTUP_FUNCTION(view_simple) {
 	YAF_INIT_CLASS_ENTRY(ce, "Yaf_View_Simple", "Yaf\\View\\Simple", yaf_view_simple_methods);
 	yaf_view_simple_ce = zend_register_internal_class_ex(&ce, NULL);
 	yaf_view_simple_ce->create_object = yaf_view_simple_new;
+#if PHP_VERSION_ID < 80100
 	yaf_view_simple_ce->serialize = zend_class_serialize_deny;
 	yaf_view_simple_ce->unserialize = zend_class_unserialize_deny;
-
+#else
+	yaf_view_simple_ce->ce_flags |= ZEND_ACC_NOT_SERIALIZABLE;
+#endif
 	zend_class_implements(yaf_view_simple_ce, 1, yaf_view_interface_ce);
 
 	memcpy(&yaf_view_simple_obj_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers));
diff --git a/yaf_application.c b/yaf_application.c
index f3e52114..e3233267 100644
--- a/yaf_application.c
+++ b/yaf_application.c
@@ -1084,10 +1084,14 @@ YAF_STARTUP_FUNCTION(application) {
 	YAF_INIT_CLASS_ENTRY(ce, "Yaf_Application", "Yaf\\Application", yaf_application_methods);
 
 	yaf_application_ce = zend_register_internal_class_ex(&ce, NULL);
-	yaf_application_ce->ce_flags |= ZEND_ACC_FINAL;
 	yaf_application_ce->create_object = yaf_application_new;
+#if PHP_VERSION_ID < 80100
+	yaf_application_ce->ce_flags |= ZEND_ACC_FINAL;
 	yaf_application_ce->serialize = zend_class_serialize_deny;
 	yaf_application_ce->unserialize = zend_class_unserialize_deny;
+#else
+	yaf_application_ce->ce_flags |= ZEND_ACC_FINAL | ZEND_ACC_NOT_SERIALIZABLE;
+#endif
 
 	memcpy(&yaf_application_obj_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers));
 	yaf_application_obj_handlers.offset = XtOffsetOf(yaf_application_object, std);
diff --git a/yaf_config.c b/yaf_config.c
index 8668734e..a02334b8 100644
--- a/yaf_config.c
+++ b/yaf_config.c
@@ -47,18 +47,61 @@ ZEND_BEGIN_ARG_INFO_EX(yaf_config_get_arginfo, 0, 0, 0)
 	ZEND_ARG_INFO(0, name)
 ZEND_END_ARG_INFO()
 
+ZEND_BEGIN_ARG_INFO_EX(yaf_config_set_arginfo, 0, 0, 2)
+	ZEND_ARG_INFO(0, name)
+	ZEND_ARG_INFO(0, value)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_INFO_EX(yaf_config_isset_arginfo, 0, 0, 1)
+	ZEND_ARG_INFO(0, name)
+ZEND_END_ARG_INFO()
+
+#if PHP_VERSION_ID < 80100
 ZEND_BEGIN_ARG_INFO_EX(yaf_config_unset_arginfo, 0, 0, 1)
 	ZEND_ARG_INFO(0, name)
 ZEND_END_ARG_INFO()
 
-ZEND_BEGIN_ARG_INFO_EX(yaf_config_set_arginfo, 0, 0, 2)
+#define yaf_config_current_arginfo yaf_config_void_arginfo
+#define yaf_config_next_arginfo    yaf_config_void_arginfo
+#define yaf_config_valid_arginfo   yaf_config_void_arginfo
+#define yaf_config_key_arginfo     yaf_config_current_arginfo
+#define yaf_config_rewind_arginfo  yaf_config_void_arginfo
+#define yaf_config_exists_arginfo  yaf_config_isset_arginfo
+#define yaf_config_oget_arginfo    yaf_config_get_arginfo
+#define yaf_config_oset_arginfo    yaf_config_set_arginfo
+#define yaf_config_count_arginfo   yaf_config_void_arginfo
+#else
+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(yaf_config_current_arginfo, 0, 0, IS_MIXED, 0)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(yaf_config_next_arginfo, 0, 0, IS_VOID, 0)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(yaf_config_valid_arginfo, 0, 0, _IS_BOOL, 0)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(yaf_config_exists_arginfo, 0, 1, _IS_BOOL, 0)
 	ZEND_ARG_INFO(0, name)
-	ZEND_ARG_INFO(0, value)
 ZEND_END_ARG_INFO()
 
-ZEND_BEGIN_ARG_INFO_EX(yaf_config_isset_arginfo, 0, 0, 1)
+ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(yaf_config_oget_arginfo, 0, 1, IS_MIXED, 0)
+	ZEND_ARG_INFO(0, name)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(yaf_config_oset_arginfo, 0, 2, IS_VOID, 0)
+	ZEND_ARG_INFO(0, name)
+	ZEND_ARG_TYPE_INFO(0, value, IS_MIXED, 0)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(yaf_config_unset_arginfo, 0, 1, IS_VOID, 0)
 	ZEND_ARG_INFO(0, name)
 ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(yaf_config_count_arginfo, 0, 0, IS_LONG, 0)
+ZEND_END_ARG_INFO()
+#define yaf_config_key_arginfo      yaf_config_current_arginfo
+#define yaf_config_rewind_arginfo   yaf_config_next_arginfo
+#endif
 /* }}} */
 
 static HashTable *yaf_config_get_gc(yaf_object *obj, zval **table, int *n) /* {{{ */ {
@@ -387,19 +430,19 @@ PHP_METHOD(yaf_config, valid) {
 */
 zend_function_entry yaf_config_methods[] = {
 	PHP_ME(yaf_config, get, yaf_config_get_arginfo, ZEND_ACC_PUBLIC)
-	PHP_ME(yaf_config, count, yaf_config_void_arginfo, ZEND_ACC_PUBLIC)
+	PHP_ME(yaf_config, count, yaf_config_count_arginfo, ZEND_ACC_PUBLIC)
 	PHP_ME(yaf_config, toArray, yaf_config_void_arginfo, ZEND_ACC_PUBLIC)
 	PHP_ME(yaf_config, offsetUnset, yaf_config_unset_arginfo, ZEND_ACC_PUBLIC)
-	PHP_ME(yaf_config, rewind, yaf_config_void_arginfo, ZEND_ACC_PUBLIC)
-	PHP_ME(yaf_config, current, yaf_config_void_arginfo, ZEND_ACC_PUBLIC)
-	PHP_ME(yaf_config, key, yaf_config_void_arginfo, ZEND_ACC_PUBLIC)
-	PHP_ME(yaf_config, next, yaf_config_void_arginfo, ZEND_ACC_PUBLIC)
-	PHP_ME(yaf_config, valid, yaf_config_void_arginfo, ZEND_ACC_PUBLIC)
+	PHP_ME(yaf_config, rewind, yaf_config_rewind_arginfo, ZEND_ACC_PUBLIC)
+	PHP_ME(yaf_config, current, yaf_config_current_arginfo, ZEND_ACC_PUBLIC)
+	PHP_ME(yaf_config, key, yaf_config_key_arginfo, ZEND_ACC_PUBLIC)
+	PHP_ME(yaf_config, next, yaf_config_next_arginfo, ZEND_ACC_PUBLIC)
+	PHP_ME(yaf_config, valid, yaf_config_valid_arginfo, ZEND_ACC_PUBLIC)
 	PHP_ME(yaf_config, __isset, yaf_config_isset_arginfo, ZEND_ACC_PUBLIC)
 	PHP_MALIAS(yaf_config, __get, get, yaf_config_get_arginfo, ZEND_ACC_PUBLIC)
-	PHP_MALIAS(yaf_config, offsetGet, get, yaf_config_get_arginfo, ZEND_ACC_PUBLIC)
-	PHP_MALIAS(yaf_config, offsetExists, __isset, yaf_config_isset_arginfo, ZEND_ACC_PUBLIC)
-	PHP_ABSTRACT_ME(yaf_config, offsetSet, yaf_config_set_arginfo)
+	PHP_MALIAS(yaf_config, offsetGet, get, yaf_config_oget_arginfo, ZEND_ACC_PUBLIC)
+	PHP_MALIAS(yaf_config, offsetExists, __isset, yaf_config_exists_arginfo, ZEND_ACC_PUBLIC)
+	PHP_ABSTRACT_ME(yaf_config, offsetSet, yaf_config_oset_arginfo)
 	PHP_ABSTRACT_ME(yaf_config, set, yaf_config_set_arginfo)
 	PHP_ABSTRACT_ME(yaf_config, readonly, yaf_config_void_arginfo)
 	{NULL, NULL, NULL}
@@ -413,10 +456,14 @@ YAF_STARTUP_FUNCTION(config) {
 
 	YAF_INIT_CLASS_ENTRY(ce, "Yaf_Config_Abstract", "Yaf\\Config_Abstract", yaf_config_methods);
 	yaf_config_ce = zend_register_internal_class_ex(&ce, NULL);
-	yaf_config_ce->ce_flags |= ZEND_ACC_EXPLICIT_ABSTRACT_CLASS;
 	yaf_config_ce->create_object = yaf_config_new;
+#if PHP_VERSION_ID < 80100
+	yaf_config_ce->ce_flags |= ZEND_ACC_EXPLICIT_ABSTRACT_CLASS;
 	yaf_config_ce->serialize = zend_class_serialize_deny;
 	yaf_config_ce->unserialize = zend_class_unserialize_deny;
+#else
+	yaf_config_ce->ce_flags |= ZEND_ACC_EXPLICIT_ABSTRACT_CLASS | ZEND_ACC_NOT_SERIALIZABLE;
+#endif
 	
 	memcpy(&yaf_config_obj_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers));
 	yaf_config_obj_handlers.offset = XtOffsetOf(yaf_config_object, std);
diff --git a/yaf_controller.c b/yaf_controller.c
index 1f7e2303..248965f7 100644
--- a/yaf_controller.c
+++ b/yaf_controller.c
@@ -845,11 +845,14 @@ YAF_STARTUP_FUNCTION(controller) {
 	zend_class_entry ce;
 	YAF_INIT_CLASS_ENTRY(ce, "Yaf_Controller_Abstract", "Yaf\\Controller_Abstract", yaf_controller_methods);
 	yaf_controller_ce = zend_register_internal_class_ex(&ce, NULL);
-	yaf_controller_ce->ce_flags |= ZEND_ACC_EXPLICIT_ABSTRACT_CLASS;
-
 	yaf_controller_ce->create_object = yaf_controller_new;
+#if PHP_VERSION_ID < 80100
+	yaf_controller_ce->ce_flags |= ZEND_ACC_EXPLICIT_ABSTRACT_CLASS;
 	yaf_controller_ce->serialize = zend_class_serialize_deny;
 	yaf_controller_ce->unserialize = zend_class_unserialize_deny;
+#else
+	yaf_controller_ce->ce_flags |= ZEND_ACC_EXPLICIT_ABSTRACT_CLASS | ZEND_ACC_NOT_SERIALIZABLE;
+#endif
 
 	memcpy(&yaf_controller_obj_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers));
 	yaf_controller_obj_handlers.offset = XtOffsetOf(yaf_controller_object, std);
diff --git a/yaf_dispatcher.c b/yaf_dispatcher.c
index 8183de42..20a4887a 100644
--- a/yaf_dispatcher.c
+++ b/yaf_dispatcher.c
@@ -1340,10 +1340,13 @@ YAF_STARTUP_FUNCTION(dispatcher) {
 	YAF_INIT_CLASS_ENTRY(ce, "Yaf_Dispatcher", "Yaf\\Dispatcher", yaf_dispatcher_methods);
 
 	yaf_dispatcher_ce = zend_register_internal_class_ex(&ce, NULL);
+#if PHP_VERSION_ID < 80100
 	yaf_dispatcher_ce->ce_flags |= ZEND_ACC_FINAL;
 	yaf_dispatcher_ce->serialize = zend_class_serialize_deny;
 	yaf_dispatcher_ce->unserialize = zend_class_unserialize_deny;
-
+#else
+	yaf_dispatcher_ce->ce_flags |= ZEND_ACC_FINAL | ZEND_ACC_NOT_SERIALIZABLE;
+#endif
 	memcpy(&yaf_dispatcher_obj_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers));
 	yaf_dispatcher_obj_handlers.offset = XtOffsetOf(yaf_dispatcher_object, std);
 	yaf_dispatcher_obj_handlers.free_obj = yaf_dispatcher_obj_free;
diff --git a/yaf_loader.c b/yaf_loader.c
index 67a5cb69..e0faefeb 100644
--- a/yaf_loader.c
+++ b/yaf_loader.c
@@ -994,9 +994,13 @@ YAF_STARTUP_FUNCTION(loader) {
 
 	YAF_INIT_CLASS_ENTRY(ce, "Yaf_Loader",  "Yaf\\Loader", yaf_loader_methods);
 	yaf_loader_ce = zend_register_internal_class_ex(&ce, NULL);
+#if PHP_VERSION_ID < 80100
 	yaf_loader_ce->ce_flags |= ZEND_ACC_FINAL;
 	yaf_loader_ce->serialize = zend_class_serialize_deny;
 	yaf_loader_ce->unserialize = zend_class_unserialize_deny;
+#else
+	yaf_loader_ce->ce_flags |= ZEND_ACC_FINAL | ZEND_ACC_NOT_SERIALIZABLE;
+#endif
 
 	memcpy(&yaf_loader_obj_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers));
 	yaf_loader_obj_handlers.clone_obj = NULL;
diff --git a/yaf_registry.c b/yaf_registry.c
index ac9030ac..36c3a50e 100644
--- a/yaf_registry.c
+++ b/yaf_registry.c
@@ -233,9 +233,13 @@ YAF_STARTUP_FUNCTION(registry) {
 	YAF_INIT_CLASS_ENTRY(ce, "Yaf_Registry", "Yaf\\Registry", yaf_registry_methods);
 
 	yaf_registry_ce = zend_register_internal_class_ex(&ce, NULL);
+#if PHP_VERSION_ID < 80100
 	yaf_registry_ce->ce_flags |= ZEND_ACC_FINAL;
 	yaf_registry_ce->serialize = zend_class_serialize_deny;
 	yaf_registry_ce->unserialize = zend_class_unserialize_deny;
+#else
+	yaf_registry_ce->ce_flags |= ZEND_ACC_FINAL | ZEND_ACC_NOT_SERIALIZABLE;
+#endif
 
 	memcpy(&yaf_registry_obj_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers));
 	yaf_registry_obj_handlers.offset = XtOffsetOf(yaf_registry_object, std);
diff --git a/yaf_request.c b/yaf_request.c
index 3a4aca50..6e758848 100644
--- a/yaf_request.c
+++ b/yaf_request.c
@@ -1437,11 +1437,14 @@ YAF_STARTUP_FUNCTION(request){
 
 	YAF_INIT_CLASS_ENTRY(ce, "Yaf_Request_Abstract", "Yaf\\Request_Abstract", yaf_request_methods);
 	yaf_request_ce	= zend_register_internal_class_ex(&ce, NULL);
-	yaf_request_ce->ce_flags |= ZEND_ACC_EXPLICIT_ABSTRACT_CLASS;
-
 	yaf_request_ce->create_object = yaf_request_new;
+#if PHP_VERSION_ID < 80100
+	yaf_request_ce->ce_flags |= ZEND_ACC_EXPLICIT_ABSTRACT_CLASS;
 	yaf_request_ce->serialize = zend_class_serialize_deny;
 	yaf_request_ce->unserialize = zend_class_unserialize_deny;
+#else
+	yaf_request_ce->ce_flags |= ZEND_ACC_EXPLICIT_ABSTRACT_CLASS | ZEND_ACC_NOT_SERIALIZABLE;
+#endif
 
 	memcpy(&yaf_request_obj_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers));
 	yaf_request_obj_handlers.offset = XtOffsetOf(yaf_request_object, std);
diff --git a/yaf_response.c b/yaf_response.c
index dc521584..0aea6775 100755
--- a/yaf_response.c
+++ b/yaf_response.c
@@ -577,11 +577,14 @@ YAF_STARTUP_FUNCTION(response) {
 	YAF_INIT_CLASS_ENTRY(ce, "Yaf_Response_Abstract", "Yaf\\Response_Abstract", yaf_response_methods);
 
 	yaf_response_ce = zend_register_internal_class_ex(&ce, NULL);
-	yaf_response_ce->ce_flags |= ZEND_ACC_EXPLICIT_ABSTRACT_CLASS;
-
 	yaf_response_ce->create_object = yaf_response_new;
+#if PHP_VERSION_ID < 80100
+	yaf_response_ce->ce_flags |= ZEND_ACC_EXPLICIT_ABSTRACT_CLASS;
 	yaf_response_ce->serialize = zend_class_serialize_deny;
 	yaf_response_ce->unserialize = zend_class_unserialize_deny;
+#else
+	yaf_response_ce->ce_flags |= ZEND_ACC_EXPLICIT_ABSTRACT_CLASS | ZEND_ACC_NOT_SERIALIZABLE;
+#endif
 
 	memcpy(&yaf_response_obj_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers));
 	yaf_response_obj_handlers.offset = XtOffsetOf(yaf_response_object, std);
diff --git a/yaf_router.c b/yaf_router.c
index 4d3e9d91..3cf6deda 100644
--- a/yaf_router.c
+++ b/yaf_router.c
@@ -424,10 +424,14 @@ YAF_STARTUP_FUNCTION(router) {
 
 	YAF_INIT_CLASS_ENTRY(ce, "Yaf_Router", "Yaf\\Router", yaf_router_methods);
 	yaf_router_ce = zend_register_internal_class_ex(&ce, NULL);
-	yaf_router_ce->ce_flags |= ZEND_ACC_FINAL;
 	yaf_router_ce->create_object = yaf_router_new;
+#if PHP_VERSION_ID < 80100
+	yaf_router_ce->ce_flags |= ZEND_ACC_FINAL;
 	yaf_router_ce->serialize = zend_class_serialize_deny;
 	yaf_router_ce->unserialize = zend_class_unserialize_deny;
+#else
+	yaf_router_ce->ce_flags |= ZEND_ACC_FINAL | ZEND_ACC_NOT_SERIALIZABLE;
+#endif
 
 	memcpy(&yaf_router_obj_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers));
 	yaf_router_obj_handlers.offset = XtOffsetOf(yaf_router_object, std);
diff --git a/yaf_session.c b/yaf_session.c
index 3dd7c9e5..4e04def4 100644
--- a/yaf_session.c
+++ b/yaf_session.c
@@ -54,6 +54,34 @@ ZEND_BEGIN_ARG_INFO_EX(yaf_session_set_arginfo, 0, 0, 2)
 	ZEND_ARG_INFO(0, name)
 	ZEND_ARG_INFO(0, value)
 ZEND_END_ARG_INFO()
+
+#if PHP_VERSION_ID < 80100
+#define yaf_session_oexists_arginfo yaf_session_has_arginfo
+#define yaf_session_oget_arginfo yaf_session_get_arginfo
+#define yaf_session_oset_arginfo yaf_session_set_arginfo
+#define yaf_session_ounset_arginfo yaf_session_del_arginfo
+#define yaf_session_count_arginfo yaf_session_void_arginfo
+#else
+ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(yaf_session_oexists_arginfo, 0, 1, _IS_BOOL, 0)
+	ZEND_ARG_INFO(0, name)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(yaf_session_oget_arginfo, 0, 1, IS_MIXED, 0)
+	ZEND_ARG_INFO(0, name)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(yaf_session_oset_arginfo, 0, 2, IS_VOID, 0)
+	ZEND_ARG_INFO(0, name)
+	ZEND_ARG_TYPE_INFO(0, value, IS_MIXED, 0)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(yaf_session_ounset_arginfo, 0, 1, IS_VOID, 0)
+	ZEND_ARG_INFO(0, name)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(yaf_session_count_arginfo, 0, 0, IS_LONG, 0)
+ZEND_END_ARG_INFO()
+#endif
 /* }}} */
 
 static inline void yaf_session_start(yaf_session_object *session) /* {{{ */ {
@@ -318,12 +346,12 @@ zend_function_entry yaf_session_methods[] = {
 	PHP_ME(yaf_session, has, yaf_session_has_arginfo, ZEND_ACC_PUBLIC)
 	PHP_ME(yaf_session, set, yaf_session_set_arginfo, ZEND_ACC_PUBLIC)
 	PHP_ME(yaf_session, del, yaf_session_del_arginfo, ZEND_ACC_PUBLIC)
-	PHP_ME(yaf_session, count, yaf_session_void_arginfo, ZEND_ACC_PUBLIC)
+	PHP_ME(yaf_session, count, yaf_session_count_arginfo, ZEND_ACC_PUBLIC)
 	PHP_ME(yaf_session, clear, yaf_session_void_arginfo, ZEND_ACC_PUBLIC)
-	PHP_MALIAS(yaf_session, offsetGet, get, yaf_session_get_arginfo, ZEND_ACC_PUBLIC)
-	PHP_MALIAS(yaf_session, offsetSet, set, yaf_session_set_arginfo, ZEND_ACC_PUBLIC)
-	PHP_MALIAS(yaf_session, offsetExists, has, yaf_session_has_arginfo, ZEND_ACC_PUBLIC)
-	PHP_MALIAS(yaf_session, offsetUnset, del, yaf_session_del_arginfo, ZEND_ACC_PUBLIC)
+	PHP_MALIAS(yaf_session, offsetGet, get, yaf_session_oget_arginfo, ZEND_ACC_PUBLIC)
+	PHP_MALIAS(yaf_session, offsetSet, set, yaf_session_oset_arginfo, ZEND_ACC_PUBLIC)
+	PHP_MALIAS(yaf_session, offsetExists, has, yaf_session_oexists_arginfo, ZEND_ACC_PUBLIC)
+	PHP_MALIAS(yaf_session, offsetUnset, del, yaf_session_ounset_arginfo, ZEND_ACC_PUBLIC)
 	PHP_MALIAS(yaf_session, __get, get, yaf_session_get_arginfo, ZEND_ACC_PUBLIC)
 	PHP_MALIAS(yaf_session, __isset, has, yaf_session_has_arginfo, ZEND_ACC_PUBLIC)
 	PHP_MALIAS(yaf_session, __set, set, yaf_session_set_arginfo, ZEND_ACC_PUBLIC)
@@ -340,11 +368,14 @@ YAF_STARTUP_FUNCTION(session) {
 	YAF_INIT_CLASS_ENTRY(ce, "Yaf_Session", "Yaf\\Session", yaf_session_methods);
 
 	yaf_session_ce = zend_register_internal_class_ex(&ce, NULL);
-	yaf_session_ce->ce_flags |= ZEND_ACC_FINAL;
-
 	yaf_session_ce->get_iterator = yaf_session_get_iterator;
+#if PHP_VERSION_ID < 80100
+	yaf_session_ce->ce_flags |= ZEND_ACC_FINAL;
 	yaf_session_ce->serialize = zend_class_serialize_deny;
 	yaf_session_ce->unserialize = zend_class_unserialize_deny;
+#else
+	yaf_session_ce->ce_flags |= ZEND_ACC_FINAL | ZEND_ACC_NOT_SERIALIZABLE;
+#endif
 
 	memcpy(&yaf_session_obj_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers));
 	yaf_session_obj_handlers.offset = XtOffsetOf(yaf_session_object, std);