Asynchronous programming has become a synonym for high performance in server side web applications in the recent years. This is largely due to the rising popularity of JavaScript and Node.js, in which everything is async by default. [...] So asynchronous programming does not push your computer into overdrive to enable higher performance. What it can do is help the computer to use it's resources more efficiently, by removing time spent waiting.

He then talks about PHP's typical flow model - synchronous and single-threaded. While it does make it simpler to debug/understand it also limits it and can cause higher processing times. Thanks to someotherprojects, however, asynchronous development with PHP has become more of a reality. He shows how to use one of these projects, Icicle, and its coroutines functionality to make a Symfony controller that handles calls to a sayHello method asynchronously, returning messages in a fraction of the normal processing time.

Event-based programming is a strange topic for PHP developers. In a language as procedural; events are little more than function calls. Nothing happens between events, and all meaningful code is still blocking.

Languages like JavaScript show us what PHP could be like if event loops were at the center. Some folks have taken these insights and coded them into event loops and HTTP servers. Today we’re going to create an HTTP server, in PHP. We’ll connect it to Apache to serve static files quickly. Everything else will pass through our PHP HTTP server, based on Icicle.

They start off showing you how to configure your Apache server to rewrite the requests (only for non-existent files) to the PHP handler. From there, he helps you get the Icicle/http library installed and create a simple HTTP server with it's included functionality. He shows how to set up routing using the LeagueRoute package and return correct HTTP response codes based on the result of the request. Finally he shows the use of the LeaguePlates library to render more complex views than just plain-text results.

The SitePoint PHP blog has posted a tutorial from Christopher Pitt introducing you to using event loops in PHP, a feature that allows for asynchronous processing, executing code while waiting for other code to finish.

PHP developers are always waiting for something. Sometimes we’re waiting for requests to remote services. Sometimes we’re waiting for databases to return rows from a complex query. Wouldn’t it be great if we could do other things during all that waiting?

If you’ve written some JS, you’re probably familiar with callbacks and DOM events. And though we have callbacks in PHP, they don’t work in quite the same way. That’s thanks to a feature called the event loop.

He starts by explaining event loops with an example from a language that naturally supports it - Javascript. He includes another example using the setTimeout function in Javascript to show a simple loop but points out that PHP just doesn't support this same kind of handling (code included). So, how can you simulate the loop like in JS? He links to and includes a examples of two libraries that could be dropped in and used to do the hard work behind the scenes of the looping: