Amazing to see so much evolution for PHP- autoloading and automatic file-based routing are such killer features for rapid development.
Fibers are going to be a gamechanger for performance once libraries start adopting it.
Amazing to see so much evolution for PHP- autoloading and automatic file-based routing are such killer features for rapid development.
Fibers are going to be a gamechanger for performance once libraries start adopting it.
I'm curious to see how useful it is until a lot of core libraries (curl, redis, mysqlnd, etc) can be called non-blocking and/or trigger a fiber yield during a block? My understanding is swoole does a whole lot of work to enable hooking into those to allow coroutines, which won't implicitly exist with fibers?
This is why fibers are so big. It'll bring performance without the downsides.
Performance without downsides.
Plenty of technical reasons but for me, the biggest is unity among libraries/technologies. There been versions of coroutines/fibers around PHP for many years, first time I heard about it was a PHP fork that implemented fibers, don't recall the name but must have been something like 10 years ago...
But the problem has always been that you cannot rely on the community having things like that available.
Having it in the core language, means that more libraries can depend on it, and users are therefore incentives to learn more about it, as they can rely on it sticking around.
Overall, I'm happy it's coming into the core language.
Probably thinking of HHVM/Hack: https://docs.hhvm.com/hack/asynchronous-operations/introduct...
Symfony 6.1 and the upcoming Laravel 10 require PHP 8.1+, but I don't see them using fibers yet. We'll have to wait and see.
{ and } is optional
$ is optional
new is optional
attribute access -> is now .
associative array (dict / map) => is now :