Open Swoole 4.5.9 released for PHP 8.0.0

Published:

Swoole v4.5.9 released today with multiple new features and enhancement. The major changes are compliantable with the PHP 8.0.0 released today.

PHP 8.0.0 new features

  • Union Types
  • Named Arguments
  • Match Expressions
  • Attributes
  • Constructor Property Promotion
  • Nullsafe Operator
  • Weak Maps
  • Just In Time Compilation
  • And much much more...

There is a good explaination article about the new features in PHP 8 at What's new in PHP 8 by @brendt_gd.

You can also check PHP 8.0 Announcement Addendum and Migrating guide from PHP 7.4.x to PHP 8.0.x.

Open Swoole 4.5.9 changes

Open Swoole 4.5.9 release is mainly for the latest PHP 8.0.0 core changes.


Enhancement
---
+ Added SWOOLE_HTTP_CLIENT_ESTATUS_SEND_FAILED constant for Coroutine\\Http\\Client (#3873) (@sy-records)


Fixed
---
* Fixed PHP8 compatibility (#3868) (#3869) (#3872) (@twose) (@huanghantao) (@doubaokun)
* Fixed undefined constant CURLOPT_HEADEROPT and CURLOPT_PROXYHEADER (swoole/library#77) (@sy-records)
* Fixed CURLOPT_USERPWD (swoole/library@7952a7b) (@twose)

Open Swoole 4.5.8 changes

New APIs
---
+ Added swoole_error_log function (swoole/swoole-src@67d2bff) (@matyhtf)
+ Supported SSL for readVector and writeVector (#3857) (@huanghantao)

Enhancement
---
+ Did not wait when the child process does not exist (#3832) (@matyhtf)
+ Supported DTLS 16k record (#3849) (@matyhtf)
+ Supported priority for cookie (#3854) (@matyhtf)
+ Supported more CURL options (swoole/library#71) (@sy-records)
+ Handled CURL header names in case insensitive manner (swoole/library#76) (@filakhtov) (@twose) (@sy-records)

Fixed
---
* Fixed readv_all and writev_all when trigger EAGAIN errno (#3830) (@huanghantao)
* Fixed warning for PHP8 (swoole/swoole-src@03f3fb0) (@matyhtf)
* Fixed binary security of swoole table keys (#3842) (@twose)
* Fixed System::writeFile append file issue when using FILE_APPEND (swoole/swoole-src@a71956d) (@matyhtf)
* Fixed CURLOPT_WRITEFUNCTION (swoole/library#74) (@sy-records)
* Fixed memory overread when parse form-data boundary (#3858) (@twose)
* Fixed is_callable() can not access internal private callable on PHP8 (#3859) (@twose)

Kernel
---
* Refactored memory allocation function, replace macro with SwooleG.std_allocator (#3853) (@matyhtf)
* Refactored pipe (#3841) (@matyhtf)

Open Swoole 4.5.7 changes

New APIs
---
+ Added writeVector, writeVectorAll, readVector, readVectorAll for Coroutine::Socket (#3764) (@huanghantao)

Enhancement
---
+ Added task_worker_num and dispatch_count for server->stats (#3771) (#3806) (@sy-records) (@matyhtf)
+ Added extension dependencies, including json, mysqlnd, sockets (#3789) (@remicollet)
+ Limited the minimum for uid server->bind is INT32_MIN (#3785) (@sy-records)
+ Added compilation option for JSON decoder, Support negative offset (#3809) (@matyhtf)
+ Added CURLOPT_TCP_NODELAY for Curl (swoole/library#65) (@sy-records) (@deminy)

Fixed
---
* Fixed sync client::connect error info (#3784) (@twose)
* Fixed the scandir function hooked (#3793) (@twose)
* Fixed some errors in the barrier (swoole/library#68) (@sy-records)

Kernel
---
* Optimized print-backtrace, using boost.stacktrace (#3788) (@matyhtf)

Open Swoole 4.5.6 changes

New APIs
---
+ Added swoole_substr_unserialize and swoole_substr_json_decode (#3762) (@matyhtf)

Enhancement
---
+ Modified Coroutine\Http\Server::onAccept to private property (#dfcc83b) (@matyhtf)

Fixed
---
* Fixed coverity issues (#3737) (#3740) (@matyhtf)
* Fixed some bugs on Alpine (#3738) (@matyhtf)
* Fixed swMutex_lockwait (#0fc5665) (@matyhtf)
* Fixed PHP-8.1 build error (#3757) (@twose)

Kernel
---
* Added check_liveness for Socket::read/write/shutdown (#3735) (@matyhtf)
* Changed the type of session_id and task_id to int64 (#3756) (@matyhtf)

You can upgrade to Swoole v4.5.9 now if you like to try PHP 8.0.0:

pecl install openswoole

Mastering Open Swoole Book

Mastering Open Swoole Book is also released today, you can preview and get it on Amazon: US, UK, DE, FR, ES, IT, NL, JP, BR, CA, MX, AU, IN