summaryrefslogtreecommitdiffstats
path: root/openswoole-php82.patch
blob: 3c590054c1f8b5a1c6be9c570fb37fd0b77df0ae (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
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
diff --git a/ext-src/php_swoole.cc b/ext-src/php_swoole.cc
index 2ee5f4054..dcfc775e4 100644
--- a/ext-src/php_swoole.cc
+++ b/ext-src/php_swoole.cc
@@ -389,6 +389,9 @@ void php_swoole_set_global_option(HashTable *vht) {
     if (php_swoole_array_get_value(vht, "max_concurrency", ztmp)) {
         SwooleG.max_concurrency = (uint32_t) SW_MAX(0, zval_get_long(ztmp));
     }
+    if (php_swoole_array_get_value(vht, "enable_server_token", ztmp) && zval_is_true(ztmp)) {
+        SwooleG.enable_server_token = zval_is_true(ztmp);
+    }
 }
 
 void php_swoole_register_rshutdown_callback(swoole::Callback cb, void *private_data) {
diff --git a/ext-src/php_swoole_cxx.cc b/ext-src/php_swoole_cxx.cc
index 3a08191e8..8ae0be5c5 100644
--- a/ext-src/php_swoole_cxx.cc
+++ b/ext-src/php_swoole_cxx.cc
@@ -18,6 +18,7 @@ typedef zval zend_source_string_t;
 typedef zend_string zend_source_string_t;
 #endif
 
+#if PHP_VERSION_ID < 80200
 static zend_op_array *swoole_compile_string(zend_source_string_t *source_string, ZEND_STR_CONST char *filename);
 
 // for compatibly with dis_eval
@@ -28,6 +29,18 @@ static zend_op_array *swoole_compile_string(zend_source_string_t *source_string,
     opa->type = ZEND_USER_FUNCTION;
     return opa;
 }
+#else
+static zend_op_array *swoole_compile_string(zend_source_string_t *source_string, ZEND_STR_CONST char *filename, zend_compile_position position);
+
+static zend_op_array *(*old_compile_string)(zend_source_string_t *source_string, ZEND_STR_CONST char *filename, zend_compile_position position);
+
+static zend_op_array *swoole_compile_string(zend_source_string_t *source_string, ZEND_STR_CONST char *filename, zend_compile_position position) {
+    zend_op_array *opa = old_compile_string(source_string, filename, position);
+    opa->type = ZEND_USER_FUNCTION;
+    return opa;
+}
+#endif
+
 
 namespace zend {
 bool eval(const std::string &code, std::string const &filename) {
diff --git a/ext-src/php_swoole_library.h b/ext-src/php_swoole_library.h
index 892f795eb..a632c9f4e 100644
--- a/ext-src/php_swoole_library.h
+++ b/ext-src/php_swoole_library.h
@@ -2,7 +2,7 @@
  * Generated by build-library.php, Please DO NOT modify!
  */
 
-/* $Id: f9f606fb95652b0c1adfc2011513808185152568 */
+/* $Id: 19668965fb5df74d799cefa05913535916135160 */
 
 static const char* swoole_library_source_constants =
     "\n"
@@ -172,6 +172,8 @@ static const char* swoole_library_source_core_constant =
     "\n"
     "    public const OPTION_MAX_CONCURRENCY = 'max_concurrency';\n"
     "\n"
+    "    public const OPTION_ENABLE_SERVER_TOKEN = 'enable_server_token';\n"
+    "\n"
     "    public const OPTION_AIO_CORE_WORKER_NUM = 'aio_core_worker_num';\n"
     "\n"
     "    public const OPTION_AIO_WORKER_NUM = 'aio_worker_num';\n"
@@ -888,12 +890,18 @@ static const char* swoole_library_source_core_array_object =
     "        return count($this->array);\n"
     "    }\n"
     "\n"
+    "    /**\n"
+    "     * @return mixed\n"
+    "     */\n"
     "    #[\\ReturnTypeWillChange]\n"
     "    public function current()\n"
     "    {\n"
     "        return current($this->array);\n"
     "    }\n"
     "\n"
+    "    /**\n"
+    "     * @return mixed\n"
+    "     */\n"
     "    #[\\ReturnTypeWillChange]\n"
     "    public function key()\n"
     "    {\n"
@@ -1065,6 +1073,7 @@ static const char* swoole_library_source_core_array_object =
     "    /**\n"
     "     * @param mixed $key\n"
     "     * @param mixed $offset\n"
+    "     * @return bool\n"
     "     */\n"
     "    #[\\ReturnTypeWillChange]\n"
     "    public function offsetExists($offset)\n"
@@ -3937,17 +3946,17 @@ static const char* swoole_library_source_core_curl_handler =
     "            case CURLOPT_PRIVATE:\n"
     "                $this->info['private'] = $value;\n"
     "                break;\n"
-    "            /*\n"
-    "             * Ignore options\n"
-    "             */\n"
+    "                /*\n"
+    "                 * Ignore options\n"
+    "                 */\n"
     "            case CURLOPT_VERBOSE:\n"
     "                // trigger_error('swoole_curl_setopt(): CURLOPT_VERBOSE is not supported', E_USER_WARNING);\n"
     "            case CURLOPT_SSLVERSION:\n"
     "            case CURLOPT_NOSIGNAL:\n"
     "            case CURLOPT_FRESH_CONNECT:\n"
-    "            /*\n"
-    "             * From PHP 5.1.3, this option has no effect: the raw output will always be returned when CURLOPT_RETURNTRANSFER is used.\n"
-    "             */\n"
+    "                /*\n"
+    "                 * From PHP 5.1.3, this option has no effect: the raw output will always be returned when CURLOPT_RETURNTRANSFER is used.\n"
+    "                 */\n"
     "            case CURLOPT_BINARYTRANSFER: /* TODO */\n"
     "            case CURLOPT_DNS_USE_GLOBAL_CACHE:\n"
     "            case CURLOPT_DNS_CACHE_TIMEOUT:\n"
@@ -3961,9 +3970,9 @@ static const char* swoole_library_source_core_curl_handler =
     "            case CURLOPT_HEADEROPT:\n"
     "            case CURLOPT_PROXYHEADER:\n"
     "                break;\n"
-    "            /*\n"
-    "             * SSL\n"
-    "             */\n"
+    "                /*\n"
+    "                 * SSL\n"
+    "                 */\n"
     "            case CURLOPT_SSL_VERIFYHOST:\n"
     "                break;\n"
     "            case CURLOPT_SSL_VERIFYPEER:\n"
@@ -3986,9 +3995,9 @@ static const char* swoole_library_source_core_curl_handler =
     "            case CURLOPT_SSLKEYPASSWD:\n"
     "                $this->clientOptions[Constant::OPTION_SSL_PASSPHRASE] = $value;\n"
     "                break;\n"
-    "            /*\n"
-    "             * Http POST\n"
-    "             */\n"
+    "                /*\n"
+    "                 * Http POST\n"
+    "                 */\n"
     "            case CURLOPT_POST:\n"
     "                $this->method = 'POST';\n"
     "                break;\n"
@@ -3998,18 +4007,18 @@ static const char* swoole_library_source_core_curl_handler =
     "                    $this->method = 'POST';\n"
     "                }\n"
     "                break;\n"
-    "            /*\n"
-    "             * Upload\n"
-    "             */\n"
+    "                /*\n"
+    "                 * Upload\n"
+    "                 */\n"
     "            case CURLOPT_SAFE_UPLOAD:\n"
     "                if (!$value) {\n"
     "                    trigger_error('swoole_curl_setopt(): Disabling safe uploads is no longer supported', E_USER_WARNING);\n"
     "                    return false;\n"
     "                }\n"
     "                break;\n"
-    "            /*\n"
-    "             * Http Header\n"
-    "             */\n"
+    "                /*\n"
+    "                 * Http Header\n"
+    "                 */\n"
     "            case CURLOPT_HTTPHEADER:\n"
     "                if (!is_array($value) and !is_iterable($value)) {\n"
     "                    trigger_error('swoole_curl_setopt(): You must pass either an object or an array with the CURLOPT_HTTPHEADER argument', E_USER_WARNING);\n"
@@ -4056,9 +4065,9 @@ static const char* swoole_library_source_core_curl_handler =
     "            case CURLOPT_FAILONERROR:\n"
     "                $this->failOnError = $value;\n"
     "                break;\n"
-    "            /*\n"
-    "             * Http Cookie\n"
-    "             */\n"
+    "                /*\n"
+    "                 * Http Cookie\n"
+    "                 */\n"
     "            case CURLOPT_COOKIE:\n"
     "                $this->setHeader('Cookie', $value);\n"
     "                break;\n"
@@ -5670,7 +5679,7 @@ static const char* swoole_library_source_core_fast_cgi_request =
     "    public function __toString(): string\n"
     "    {\n"
     "        $body = $this->getBody();\n"
-    "        $beginRequestFrame = new BeginRequest(FastCGI::RESPONDER, ($this->keepConn ? FastCGI::KEEP_CONN : 0));\n"
+    "        $beginRequestFrame = new BeginRequest(FastCGI::RESPONDER, $this->keepConn ? FastCGI::KEEP_CONN : 0);\n"
     "        $paramsFrame = new Params($this->getParams());\n"
     "        $paramsEofFrame = new Params();\n"
     "        if (empty($body)) {\n"
@@ -6622,7 +6631,7 @@ static const char* swoole_library_source_core_coroutine_fast_cgi_proxy =
     "            $server = $userRequest->server;\n"
     "            $headers = $userRequest->header;\n"
     "            $pathInfo = $userRequest->server['path_info'];\n"
-    "            $pathInfo = '/' . (ltrim($pathInfo, '/'));\n"
+    "            $pathInfo = '/' . ltrim($pathInfo, '/');\n"
     "            if (strlen($this->index) !== 0) {\n"
     "                $extension = pathinfo($pathInfo, PATHINFO_EXTENSION);\n"
     "                if (empty($extension)) {\n"
@@ -6675,7 +6684,7 @@ static const char* swoole_library_source_core_coroutine_fast_cgi_proxy =
     "\n"
     "    public function pass($userRequest, $userResponse): void\n"
     "    {\n"
-    "        if (!($userRequest instanceof HttpRequest)) {\n"
+    "        if (!$userRequest instanceof HttpRequest) {\n"
     "            $request = $this->translateRequest($userRequest);\n"
     "        } else {\n"
     "            $request = $userRequest;\n"
@@ -6727,6 +6736,7 @@ static const char* swoole_library_source_core_process_manager =
     "namespace Swoole\\Process;\n"
     "\n"
     "use Swoole\\Constant;\n"
+    "\n"
     "use function Swoole\\Coroutine\\run;\n"
     "\n"
     "class Manager\n"
@@ -6914,6 +6924,7 @@ static const char* swoole_library_source_core_server_helper =
     "        'http2_max_concurrent_streams' => true,\n"
     "        'http2_max_frame_size' => true,\n"
     "        'http2_max_header_list_size' => true,\n"
+    "        'enable_server_token' => true,\n"
     "    ];\n"
     "\n"
     "    public const PORT_OPTIONS = [\n"
@@ -6972,7 +6983,7 @@ static const char* swoole_library_source_core_server_helper =
     "\n"
     "        foreach ($input_options as $k => $v) {\n"
     "            if (!array_key_exists(strtolower($k), $const_options)) {\n"
-    "                //TODO throw exception\n"
+    "                // TODO throw exception\n"
     "                trigger_error(\"Unknown option [{$k}]\", E_USER_WARNING);\n"
     "                debug_print_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);\n"
     "            }\n"
@@ -7001,85 +7012,85 @@ static const char* swoole_library_source_core_server_helper =
     "        $event_workers = '';\n"
     "        $event_workers .= \"# TYPE openswoole_event_workers_start_time gauge\\n\";\n"
     "        foreach ($stats['event_workers'] as $stat) {\n"
-    "            $event_workers .= \"openswoole_event_workers_start_time{worker_id=\\\"{$stat['worker_id']}\\\"} ${stat['start_time']}\\n\";\n"
+    "            $event_workers .= \"openswoole_event_workers_start_time{worker_id=\\\"{$stat['worker_id']}\\\"} {$stat['start_time']}\\n\";\n"
     "        }\n"
     "        $event_workers .= \"# TYPE openswoole_event_workers_start_seconds gauge\\n\";\n"
     "        foreach ($stats['event_workers'] as $stat) {\n"
-    "            $event_workers .= \"openswoole_event_workers_start_seconds{worker_id=\\\"{$stat['worker_id']}\\\"} ${stat['start_seconds']}\\n\";\n"
+    "            $event_workers .= \"openswoole_event_workers_start_seconds{worker_id=\\\"{$stat['worker_id']}\\\"} {$stat['start_seconds']}\\n\";\n"
     "        }\n"
     "        $event_workers .= \"# TYPE openswoole_event_workers_dispatch_count gauge\\n\";\n"
     "        foreach ($stats['event_workers'] as $stat) {\n"
-    "            $event_workers .= \"openswoole_event_workers_dispatch_count{worker_id=\\\"{$stat['worker_id']}\\\"} ${stat['dispatch_count']}\\n\";\n"
+    "            $event_workers .= \"openswoole_event_workers_dispatch_count{worker_id=\\\"{$stat['worker_id']}\\\"} {$stat['dispatch_count']}\\n\";\n"
     "        }\n"
     "        $event_workers .= \"# TYPE openswoole_event_workers_request_count gauge\\n\";\n"
     "        foreach ($stats['event_workers'] as $stat) {\n"
-    "            $event_workers .= \"openswoole_event_workers_request_count{worker_id=\\\"{$stat['worker_id']}\\\"} ${stat['request_count']}\\n\";\n"
+    "            $event_workers .= \"openswoole_event_workers_request_count{worker_id=\\\"{$stat['worker_id']}\\\"} {$stat['request_count']}\\n\";\n"
     "        }\n"
     "\n"
     "        $task_workers = '';\n"
     "        $task_workers .= \"# TYPE openswoole_task_workers_start_time gauge\\n\";\n"
     "        foreach ($stats['task_workers'] as $stat) {\n"
-    "            $task_workers .= \"openswoole_task_workers_start_time{worker_id=\\\"{$stat['worker_id']}\\\"} ${stat['start_time']}\\n\";\n"
+    "            $task_workers .= \"openswoole_task_workers_start_time{worker_id=\\\"{$stat['worker_id']}\\\"} {$stat['start_time']}\\n\";\n"
     "        }\n"
     "        $task_workers .= \"# TYPE openswoole_task_workers_start_seconds gauge\\n\";\n"
     "        foreach ($stats['task_workers'] as $stat) {\n"
-    "            $task_workers .= \"openswoole_task_workers_start_seconds{worker_id=\\\"{$stat['worker_id']}\\\"} ${stat['start_seconds']}\\n\";\n"
+    "            $task_workers .= \"openswoole_task_workers_start_seconds{worker_id=\\\"{$stat['worker_id']}\\\"} {$stat['start_seconds']}\\n\";\n"
     "        }\n"
     "\n"
     "        $user_workers = '';\n"
     "        $user_workers .= \"# TYPE openswoole_user_workers_start_time gauge\\n\";\n"
     "        foreach ($stats['user_workers'] as $stat) {\n"
-    "            $user_workers .= \"openswoole_user_workers_start_time{worker_id=\\\"{$stat['worker_id']}\\\"} ${stat['start_time']}\\n\";\n"
+    "            $user_workers .= \"openswoole_user_workers_start_time{worker_id=\\\"{$stat['worker_id']}\\\"} {$stat['start_time']}\\n\";\n"
     "        }\n"
     "        $user_workers .= \"# TYPE openswoole_user_workers_start_seconds gauge\\n\";\n"
     "        foreach ($stats['user_workers'] as $stat) {\n"
-    "            $user_workers .= \"openswoole_user_workers_start_seconds{worker_id=\\\"{$stat['worker_id']}\\\"} ${stat['start_seconds']}\\n\";\n"
+    "            $user_workers .= \"openswoole_user_workers_start_seconds{worker_id=\\\"{$stat['worker_id']}\\\"} {$stat['start_seconds']}\\n\";\n"
     "        }\n"
     "\n"
     "        return \"# TYPE openswoole_info gauge\\n\"\n"
     "                . \"openswoole_info{version=\\\"{$stats['version']}\\\"} 1\\n\"\n"
     "                . \"# TYPE openswoole_up gauge\\n\"\n"
-    "                . \"openswoole_up ${stats['up']}\\n\"\n"
+    "                . \"openswoole_up {$stats['up']}\\n\"\n"
     "                . \"# TYPE openswoole_reactor_num gauge\\n\"\n"
-    "                . \"openswoole_reactor_threads_num ${stats['reactor_threads_num']}\\n\"\n"
+    "                . \"openswoole_reactor_threads_num {$stats['reactor_threads_num']}\\n\"\n"
     "                . \"# TYPE openswoole_requests counter\\n\"\n"
-    "                . \"openswoole_requests_total ${stats['requests_total']}\\n\"\n"
+    "                . \"openswoole_requests_total {$stats['requests_total']}\\n\"\n"
     "                . \"# TYPE openswoole_start_time gauge\\n\"\n"
-    "                . \"openswoole_start_time ${stats['start_time']}\\n\"\n"
+    "                . \"openswoole_start_time {$stats['start_time']}\\n\"\n"
     "                . \"# TYPE openswoole_max_conn gauge\\n\"\n"
-    "                . \"openswoole_max_conn ${stats['max_conn']}\\n\"\n"
+    "                . \"openswoole_max_conn {$stats['max_conn']}\\n\"\n"
     "                . \"# TYPE openswoole_coroutine_num gauge\\n\"\n"
-    "                . \"openswoole_coroutine_num ${stats['coroutine_num']}\\n\"\n"
+    "                . \"openswoole_coroutine_num {$stats['coroutine_num']}\\n\"\n"
     "                . \"# TYPE openswoole_start_seconds gauge\\n\"\n"
-    "                . \"openswoole_start_seconds ${stats['start_seconds']}\\n\"\n"
+    "                . \"openswoole_start_seconds {$stats['start_seconds']}\\n\"\n"
     "                . \"# TYPE openswoole_workers_total gauge\\n\"\n"
-    "                . \"openswoole_workers_total ${stats['workers_total']}\\n\"\n"
+    "                . \"openswoole_workers_total {$stats['workers_total']}\\n\"\n"
     "                . \"# TYPE openswoole_workers_idle gauge\\n\"\n"
-    "                . \"openswoole_workers_idle ${stats['workers_idle']}\\n\"\n"
+    "                . \"openswoole_workers_idle {$stats['workers_idle']}\\n\"\n"
     "                . \"# TYPE openswoole_task_workers_total gauge\\n\"\n"
-    "                . \"openswoole_task_workers_total ${stats['task_workers_total']}\\n\"\n"
+    "                . \"openswoole_task_workers_total {$stats['task_workers_total']}\\n\"\n"
     "                . \"# TYPE openswoole_task_workers_idle gauge\\n\"\n"
-    "                . \"openswoole_task_workers_idle ${stats['task_workers_idle']}\\n\"\n"
+    "                . \"openswoole_task_workers_idle {$stats['task_workers_idle']}\\n\"\n"
     "                . \"# TYPE openswoole_user_workers_total gauge\\n\"\n"
-    "                . \"openswoole_user_workers_total ${stats['user_workers_total']}\\n\"\n"
+    "                . \"openswoole_user_workers_total {$stats['user_workers_total']}\\n\"\n"
     "                . \"# TYPE openswoole_dispatch_total gauge\\n\"\n"
-    "                . \"openswoole_dispatch_total ${stats['dispatch_total']}\\n\"\n"
+    "                . \"openswoole_dispatch_total {$stats['dispatch_total']}\\n\"\n"
     "                . \"# TYPE openswoole_connections_accepted gauge\\n\"\n"
-    "                . \"openswoole_connections_accepted ${stats['connections_accepted']}\\n\"\n"
+    "                . \"openswoole_connections_accepted {$stats['connections_accepted']}\\n\"\n"
     "                . \"# TYPE openswoole_connections_active gauge\\n\"\n"
-    "                . \"openswoole_connections_active ${stats['connections_active']}\\n\"\n"
+    "                . \"openswoole_connections_active {$stats['connections_active']}\\n\"\n"
     "                . \"# TYPE openswoole_connections_closed gauge\\n\"\n"
-    "                . \"openswoole_connections_closed ${stats['connections_closed']}\\n\"\n"
+    "                . \"openswoole_connections_closed {$stats['connections_closed']}\\n\"\n"
     "                . \"# TYPE openswoole_reload_count gauge\\n\"\n"
-    "                . \"openswoole_reload_count ${stats['reload_count']}\\n\"\n"
+    "                . \"openswoole_reload_count {$stats['reload_count']}\\n\"\n"
     "                . \"# TYPE openswoole_reload_last_time gauge\\n\"\n"
-    "                . \"openswoole_reload_last_time ${stats['reload_last_time']}\\n\"\n"
+    "                . \"openswoole_reload_last_time {$stats['reload_last_time']}\\n\"\n"
     "                . \"# TYPE openswoole_worker_vm_object_num gauge\\n\"\n"
-    "                . \"openswoole_worker_vm_object_num ${stats['worker_vm_object_num']}\\n\"\n"
+    "                . \"openswoole_worker_vm_object_num {$stats['worker_vm_object_num']}\\n\"\n"
     "                . \"# TYPE openswoole_worker_vm_resource_num gauge\\n\"\n"
-    "                . \"openswoole_worker_vm_resource_num ${stats['worker_vm_resource_num']}\\n\"\n"
+    "                . \"openswoole_worker_vm_resource_num {$stats['worker_vm_resource_num']}\\n\"\n"
     "                . \"# TYPE openswoole_worker_memory_usage gauge\\n\"\n"
-    "                . \"openswoole_worker_memory_usage ${stats['worker_memory_usage']}\\n{$event_workers}{$task_workers}{$user_workers}\"\n"
+    "                . \"openswoole_worker_memory_usage {$stats['worker_memory_usage']}\\n{$event_workers}{$task_workers}{$user_workers}\"\n"
     "                . '# EOF';\n"
     "    }\n"
     "}\n";
@@ -7181,7 +7192,7 @@ static const char* swoole_library_source_core_coroutine_functions =
     "            echo Coroutine::printBackTrace($cid, DEBUG_BACKTRACE_IGNORE_ARGS, $depth);\n"
     "            echo \"\\n\";\n"
     "            $index++;\n"
-    "            //limit the number of maximum outputs\n"
+    "            // limit the number of maximum outputs\n"
     "            if ($index >= $limit) {\n"
     "                break;\n"
     "            }\n"
@@ -7577,28 +7588,28 @@ static const char* swoole_library_source_functions =
     "        $type = $_f->get(1)->trim();\n"
     "\n"
     "        switch ($type) {\n"
-    "        case 'i':\n"
-    "        case 'int':\n"
-    "            $table->column($name, Swoole\\Table::TYPE_INT);\n"
-    "            break;\n"
-    "        case 'f':\n"
-    "        case 'float':\n"
-    "            $table->column($name, Swoole\\Table::TYPE_FLOAT);\n"
-    "            break;\n"
-    "        case 's':\n"
-    "        case 'string':\n"
-    "            if ($_f->count() < 3) {\n"
-    "                throw new RuntimeException('need to give string length');\n"
-    "            }\n"
-    "            $length = intval($_f->get(2)->trim()->toString());\n"
-    "            if ($length <= 0) {\n"
-    "                throw new RuntimeException(\"invalid string length[{$length}]\");\n"
-    "            }\n"
-    "            $table->column($name, Swoole\\Table::TYPE_STRING, $length);\n"
-    "            break;\n"
-    "        default:\n"
-    "            throw new RuntimeException(\"unknown field type[{$type}]\");\n"
-    "            break;\n"
+    "            case 'i':\n"
+    "            case 'int':\n"
+    "                $table->column($name, Swoole\\Table::TYPE_INT);\n"
+    "                break;\n"
+    "            case 'f':\n"
+    "            case 'float':\n"
+    "                $table->column($name, Swoole\\Table::TYPE_FLOAT);\n"
+    "                break;\n"
+    "            case 's':\n"
+    "            case 'string':\n"
+    "                if ($_f->count() < 3) {\n"
+    "                    throw new RuntimeException('need to give string length');\n"
+    "                }\n"
+    "                $length = intval($_f->get(2)->trim()->toString());\n"
+    "                if ($length <= 0) {\n"
+    "                    throw new RuntimeException(\"invalid string length[{$length}]\");\n"
+    "                }\n"
+    "                $table->column($name, Swoole\\Table::TYPE_STRING, $length);\n"
+    "                break;\n"
+    "            default:\n"
+    "                throw new RuntimeException(\"unknown field type[{$type}]\");\n"
+    "                break;\n"
     "        }\n"
     "    }\n"
     "\n"
diff --git a/ext-src/swoole_coroutine.cc b/ext-src/swoole_coroutine.cc
index 9dc0def33..2b9d1105b 100644
--- a/ext-src/swoole_coroutine.cc
+++ b/ext-src/swoole_coroutine.cc
@@ -66,7 +66,12 @@ bool PHPCoroutine::interrupt_thread_running = false;
 
 extern void php_swoole_load_library();
 
+#if PHP_VERSION_ID < 80200
 static zend_bool *zend_vm_interrupt = nullptr;
+#else
+static zend_atomic_bool *zend_vm_interrupt = nullptr;
+#endif
+
 static user_opcode_handler_t ori_exit_handler = nullptr;
 static user_opcode_handler_t ori_begin_silence_handler = nullptr;
 static user_opcode_handler_t ori_end_silence_handler = nullptr;
@@ -406,12 +411,18 @@ void PHPCoroutine::interrupt_thread_start() {
     if (interrupt_thread_running) {
         return;
     }
+#if PHP_VERSION_ID < 80200
     zend_vm_interrupt = &EG(vm_interrupt);
+#endif
     interrupt_thread_running = true;
     interrupt_thread = std::thread([]() {
         swoole_signal_block_all();
         while (interrupt_thread_running) {
+#if PHP_VERSION_ID < 80200
             *zend_vm_interrupt = 1;
+#else
+            zend_atomic_bool_store_ex(&EG(vm_interrupt), true);
+#endif
             std::this_thread::sleep_for(std::chrono::milliseconds(MAX_EXEC_MSEC / 2));
         }
     });
diff --git a/ext-src/swoole_http_response.cc b/ext-src/swoole_http_response.cc
index 50fe019bc..aa947f6fc 100644
--- a/ext-src/swoole_http_response.cc
+++ b/ext-src/swoole_http_response.cc
@@ -395,7 +395,7 @@ static void http_build_header(HttpContext *ctx, String *response, size_t body_le
         SW_HASHTABLE_FOREACH_END();
     }
 
-    if (!(header_flags & HTTP_HEADER_SERVER)) {
+    if (!(header_flags & HTTP_HEADER_SERVER) && SwooleG.enable_server_token) {
         response->append(ZEND_STRL("Server: " SW_HTTP_SERVER_SOFTWARE "\r\n"));
     }
 
diff --git a/ext-src/swoole_websocket_server.cc b/ext-src/swoole_websocket_server.cc
index 578dc703e..8e2494f73 100644
--- a/ext-src/swoole_websocket_server.cc
+++ b/ext-src/swoole_websocket_server.cc
@@ -274,9 +274,8 @@ void swoole_websocket_onRequest(HttpContext *ctx) {
                               "Connection: close\r\n"
                               "Content-Type: text/html; charset=UTF-8\r\n"
                               "Cache-Control: must-revalidate,no-cache,no-store\r\n"
-                              "Content-Length: 83\r\n"
-                              "Server: " SW_HTTP_SERVER_SOFTWARE "\r\n\r\n"
-                              "<html><body><h2>HTTP 400 Bad Request</h2><hr><i>Powered by Swoole</i></body></html>";
+                              "Content-Length: 55\r\n\r\n"
+                              "<html><body><h2>HTTP 400 Bad Request</h2></body></html>";
 
     ctx->send(ctx, (char *) bad_request, strlen(bad_request));
     ctx->end_ = 1;
diff --git a/include/swoole.h b/include/swoole.h
index 832f66b9e..ae07c0b4c 100644
--- a/include/swoole.h
+++ b/include/swoole.h
@@ -646,6 +646,7 @@ struct Global {
     struct utsname uname;
     uint32_t max_sockets;
     uint32_t max_concurrency;
+    bool enable_server_token;
     //-----------------------[Memory]--------------------------
     MemoryPool *memory_pool;
     Allocator std_allocator;
diff --git a/src/core/base.cc b/src/core/base.cc
index 4a241847b..11e170f2e 100644
--- a/src/core/base.cc
+++ b/src/core/base.cc
@@ -172,6 +172,7 @@ void swoole_init(void) {
     SwooleG.memory_pool = new swoole::GlobalMemory(SW_GLOBAL_MEMORY_PAGESIZE, true);
     SwooleG.max_sockets = SW_MAX_SOCKETS_DEFAULT;
     SwooleG.max_concurrency = 0;
+    SwooleG.enable_server_token = false;
     struct rlimit rlmt;
     if (getrlimit(RLIMIT_NOFILE, &rlmt) < 0) {
         swoole_sys_warning("getrlimit() failed");
diff --git a/thirdparty/php/curl/curl_private.h b/thirdparty/php/curl/curl_private.h
index e64bbbb6e..4b8e2128a 100644
--- a/thirdparty/php/curl/curl_private.h
+++ b/thirdparty/php/curl/curl_private.h
@@ -68,12 +68,22 @@ typedef struct {
 	int                   method;
 } php_curl_progress, php_curl_fnmatch, php_curlm_server_push;
 
+typedef struct {
+	zval                  func_name;
+	zend_fcall_info_cache fci_cache;
+} php_curl_callback;
+
 typedef struct {
 	php_curl_write    *write;
 	php_curl_write    *write_header;
 	php_curl_read     *read;
 	zval               std_err;
 	php_curl_progress *progress;
+#if PHP_VERSION_ID >= 80200
+#if LIBCURL_VERSION_NUM >= 0x072000
+	php_curl_callback  *xferinfo;
+#endif
+#endif
 #if LIBCURL_VERSION_NUM >= 0x071500 /* Available since 7.21.0 */
 	php_curl_fnmatch  *fnmatch;
 #endif
@@ -214,8 +224,13 @@ static inline php_curlsh *curl_share_from_obj(zend_object *obj) {
 
 #define Z_CURL_SHARE_P(zv) curl_share_from_obj(Z_OBJ_P(zv))
 void curl_multi_register_class(const zend_function_entry *method_entries);
+
+#if PHP_VERSION_ID < 80200
 int swoole_curl_cast_object(zend_object *obj, zval *result, int type);
 #else
+zend_result swoole_curl_cast_object(zend_object *obj, zval *result, int type);
+#endif
+#else
 #define Z_CURL_P(zv)     swoole_curl_get_handle(zv)
 #endif /* PHP8 end */
 
diff --git a/thirdparty/php/curl/interface.cc b/thirdparty/php/curl/interface.cc
index 43a289d00..3897b58fd 100644
--- a/thirdparty/php/curl/interface.cc
+++ b/thirdparty/php/curl/interface.cc
@@ -85,6 +85,9 @@ static zend_object_handlers swoole_native_curl_exception_handlers;
 #if PHP_VERSION_ID < 80000
 static int le_curl;
 static int le_curl_multi_handle;
+static int le_curl_share_handle;
+#define le_curl_share_handle_name "cURL Share Handle"
+
 
 int swoole_curl_get_le_curl() {
     return le_curl;
@@ -454,6 +457,14 @@ static HashTable *swoole_curl_get_gc(zend_object *object, zval **table, int *n)
             zend_get_gc_buffer_add_zval(gc_buffer, &curl_handlers(curl)->progress->func_name);
         }
 
+#if PHP_VERSION_ID >= 80200
+#if LIBCURL_VERSION_NUM >= 0x072000
+        if (curl->handlers.xferinfo) {
+            zend_get_gc_buffer_add_zval(gc_buffer, &curl_handlers(curl)->xferinfo->func_name);
+        }
+#endif
+#endif
+
 #if LIBCURL_VERSION_NUM >= 0x071500
         if (curl_handlers(curl)->fnmatch) {
             zend_get_gc_buffer_add_zval(gc_buffer, &curl_handlers(curl)->fnmatch->func_name);
@@ -472,6 +483,7 @@ static HashTable *swoole_curl_get_gc(zend_object *object, zval **table, int *n)
     return zend_std_get_properties(object);
 }
 
+#if PHP_VERSION_ID < 80200
 int swoole_curl_cast_object(zend_object *obj, zval *result, int type) {
     if (type == IS_LONG) {
         /* For better backward compatibility, make (int) $curl_handle return the object ID,
@@ -482,6 +494,19 @@ int swoole_curl_cast_object(zend_object *obj, zval *result, int type) {
 
     return zend_std_cast_object_tostring(obj, result, type);
 }
+#else
+zend_result swoole_curl_cast_object(zend_object *obj, zval *result, int type) {
+    if (type == IS_LONG) {
+        /* For better backward compatibility, make (int) $curl_handle return the object ID,
+         * similar to how it previously returned the resource ID. */
+        ZVAL_LONG(result, obj->handle);
+        return SUCCESS;
+    }
+
+    return zend_std_cast_object_tostring(obj, result, type);
+}
+#endif
+
 #endif
 
 void swoole_native_curl_mshutdown() {}
@@ -928,6 +953,11 @@ php_curl *swoole_curl_alloc_handle()
     curl_handlers(ch)->write_header = (php_curl_write *) ecalloc(1, sizeof(php_curl_write));
     curl_handlers(ch)->read = (php_curl_read *) ecalloc(1, sizeof(php_curl_read));
     curl_handlers(ch)->progress = NULL;
+#if PHP_VERSION_ID >= 80200
+#if LIBCURL_VERSION_NUM >= 0x072000
+    curl_handlers(ch)->xferinfo = NULL;
+#endif
+#endif
 #if LIBCURL_VERSION_NUM >= 0x071500 /* Available since 7.21.0 */
     curl_handlers(ch)->fnmatch = NULL;
 #endif
@@ -2147,6 +2177,7 @@ static int _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue) /* {{{
     /* Curl off_t options */
     case CURLOPT_MAX_RECV_SPEED_LARGE:
     case CURLOPT_MAX_SEND_SPEED_LARGE:
+    case CURLOPT_MAXFILESIZE_LARGE:
 #if LIBCURL_VERSION_NUM >= 0x073b00 /* Available since 7.59.0 */
     case CURLOPT_TIMEVALUE_LARGE:
 #endif
@@ -2206,9 +2237,25 @@ static int _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue) /* {{{
         }
         break;
 
-    case CURLOPT_SHARE: {
-        php_error_docref(NULL, E_WARNING, "CURLOPT_SHARE option is not supported");
-    } break;
+    case CURLOPT_SHARE:
+#if PHP_VERSION_ID >= 80000
+        if (Z_TYPE_P(zvalue) == IS_OBJECT && Z_OBJCE_P(zvalue) == curl_share_ce) {
+            php_curlsh *sh = Z_CURL_SHARE_P(zvalue);
+            curl_easy_setopt(ch->cp, CURLOPT_SHARE, sh->share);
+
+            if (ch->share) {
+                OBJ_RELEASE(&ch->share->std);
+            }
+            GC_ADDREF(&sh->std);
+            ch->share = sh;
+        }
+#else
+        php_curlsh *sh;
+        if ((sh = (php_curlsh *) zend_fetch_resource_ex(zvalue, le_curl_share_handle_name, le_curl_share_handle))) {
+            curl_easy_setopt(ch->cp, CURLOPT_SHARE, sh->share);
+        }
+#endif
+        break;
 
 #if LIBCURL_VERSION_NUM >= 0x071500 /* Available since 7.21.0 */
     case CURLOPT_FNMATCH_FUNCTION:
@@ -2852,6 +2899,15 @@ static void _php_curl_free(php_curl *ch) {
         efree(curl_handlers(ch)->progress);
     }
 
+#if PHP_VERSION_ID >= 80200
+#if LIBCURL_VERSION_NUM >= 0x072000
+    if (curl_handlers(ch)->xferinfo) {
+        zval_ptr_dtor(&curl_handlers(ch)->xferinfo->func_name);
+        efree(curl_handlers(ch)->xferinfo);
+    }
+#endif
+#endif
+
 #if LIBCURL_VERSION_NUM >= 0x071500
     if (curl_handlers(ch)->fnmatch) {
         zval_ptr_dtor(&curl_handlers(ch)->fnmatch->func_name);
@@ -2957,6 +3013,15 @@ static void _php_curl_reset_handlers(php_curl *ch) {
         curl_handlers(ch)->progress = NULL;
     }
 
+#if PHP_VERSION_ID >= 80200
+#if LIBCURL_VERSION_NUM >= 0x072000
+    if (curl_handlers(ch)->xferinfo) {
+        zval_ptr_dtor(&curl_handlers(ch)->xferinfo->func_name);
+        efree(curl_handlers(ch)->xferinfo);
+    }
+#endif
+#endif
+
 #if LIBCURL_VERSION_NUM >= 0x071500 /* Available since 7.21.0 */
     if (curl_handlers(ch)->fnmatch) {
         zval_ptr_dtor(&curl_handlers(ch)->fnmatch->func_name);