Coroutines in Swoole

Introduction In this post I will go through some details about the coroutines in Swoole (v4.0+). The first sections will explain the basics and certain details and then examples will be given. Numbers in [] refer to entries in the Notes section, while numbers in () refer to the Examples section. There are many links…

Swoole\Coroutine\System namespace in Swoole 4.4.6

In Swoole 4.4.6 the coroutine methods related to the filesystem, name resolution, and few others will be moved from Swoole\Coroutine to Swoole\Coroutine\System. The recommended way will be to access Co\System::sleep() instead of Co::sleep(). As a side note – here is a tool for dumping all Swoole classes. It is useful as the documentation is sometimes…

Union types in PHP (again), Github RFCs

There has been a new proposal by Nikita Popov about introducing Union types in PHP. There has been a previous proposal which has been rejected. I think PHP really needs this especially in the light that PHP internal functions have return types that are incompatible with the current type system ( fread() returns string|false). This…

Swoole 4.4.4 is out

Swoole 4.4.4 was released on 17th. One thing that is not mentioned in the Release notes is that the Strict Mode is now deprecated. If used it produces the following message: Swoole\Runtime::enableStrictMode(): Swoole\Runtime::enableStrictMode is deprecated, it will be removed in v4.5.0

Interesting discussions at PHP-internals

In the last few weeks, there are two unrelated discussions at PHP-internals mailing list that I personally follow and show the various opinions and considerations in the PHP community and internals about the new features and the backward compatibility and the future of the language: Deprecating PHP’s short open tags, again – this triggered a…