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…