Swoole PHP 4.6.4 released: support MacOS M1 (ARM 64 build), bug fixes and more

Swoole v4.6.4 is released with multiple enhancements and bug fixes.

New API

Added Coroutine\Http::request, Coroutine\Http::post, Coroutine\Http::get

Example of Coroutine\Http::get:

<?php

use function Swoole\Coroutine\Http\get;
use function Swoole\Coroutine\Http\post;

Co\run(function() {
    $data = get('http://httpbin.org/get?hello=world');
    $body = json_decode($data->getBody());
    var_dump($body);
});

Example of Coroutine\Http::post:

<?php

use function Swoole\Coroutine\Http\get;
use function Swoole\Coroutine\Http\post;

Co\run(function() {
    $random_data = base64_encode(random_bytes(128));
    $data = post('http://httpbin.org/post?hello=world', ['random_data' => $random_data]);
    $body = json_decode($data->getBody());
    var_dump($body);
});

List of changes in v4.6.4

New API
---
+ Added Coroutine\Http::request, Coroutine\Http::post, Coroutine\Http::get (swoole/library#97) (@matyhtf)

Enhancement
---
+ Supported ARM 64 build (#4057) (@devnexen)
+ Supported set open_http_protocol in Swoole TCP Server (#4063) (@matyhtf)
+ Supported ssl client only set certificate (swoole/[email protected]) (@matyhtf)
+ Supported ssl client only set certificate (swoole/[email protected]) (@matyhtf)
+ Supported tcp_defer_accept option for FreeBSD (#4049) (@devnexen)

Fixed
---
* Fixed Proxy-Authorization missing when use Coroutine\Http\Client (swoole/[email protected]) (@matyhtf)
* Fixed memory allocation issues with Swoole\Table (swoole/[email protected]) (@matyhtf)
* Fixed crash when Coroutine\Http2\Client connects concurrently (swoole/[email protected]) (@matyhtf)
* Fixed enable_ssl_encrypt with DTLS (swoole/[email protected]) (@matyhtf)
* Fixed Coroutine\Barrier mem leak (swoole/library#94) (@Appla) (@FMiS)
* Fixed the offset error caused by CURLOPT_PORT and CURLOPT_URL order (swoole/library#96) (@sy-records)
* Fixed Table::get($key, $field) when field type is float (swoole/[email protected]) (@matyhtf)
* Fixed Swoole\Table mem leaks (swoole/[email protected]) (@matyhtf)

You can upgrade to Swoole v4.6.4 now:

pecl install swoole