Category: Performance & Scaling

Functional Programming with Phunkie: Funky Parser Combinators

Phunkie is a library with functional structures for PHP. In this tutorial, Phunkie creator Marcello Duarte, head of training at Inviqa, explains how to create Parser combinators using the functional library. This post first appeared on the Inviqa blog, and was republished here with their permission.Learning functiona...

Make Your Own Social Network, Game Server, or Knowledgebase! – Sourcehunt

It’s time for our monthly hunt for new open source libraries to use and contribute to! If you’re new to Sourcehunt, it’s our monthly post for promoting open source projects that seem interesting or promising and could use help in terms of Github stars or pull requests. It’s our way of giving bac...

Procedurally Generated Game Terrain with React, PHP, and WebSockets

Last time, I began telling you the story of how I wanted to make a game. I described how I set up the async PHP server, the Laravel Mix build chain, the React front end, and WebSockets connecting all this together. Now, let me tell you about what happened when I starting building the game mechanics with this mix of Rea...

Upgrading from PThreads v2 to V3: What to Look out For

A fair amount has changed for the pthreads extension with the release of pthreads v3. This article aims to cover the necessary information for those who are looking to upgrade their applications from pthreads v2 to v3. If you’re unfamiliar with pthreads, check out my introduction to pthreads instead! A big thank ...

Game Development with React and PHP: How Compatible Are They?

“I’d like to make a multiplayer, economy-based game. Something like Stardew Valley, but with none of the befriending aspects and a player-based economy.” I started thinking about this the moment I decided to try and build a game using PHP and React. The trouble is, I knew nothing about the dynamics of...

Parallel Programming with Pthreads in PHP – the Fundamentals

PHP developers seem to rarely utilise parallelism. The appeal of the simplicity of synchronous, single-threaded programming certainly is high, but sometimes the usage of a little concurrency can bring some worthwhile performance improvements. In this article, we will be taking a look at how threading can be achieved in...

Writing Async Libraries – Let’s Convert HTML to PDF

I can barely remember a conference where the topic of asynchronous PHP wasn’t discussed. I am pleased that it’s so frequently spoken about these days. There’s a secret these speakers aren’t telling, though…Making asynchronous servers, resolving domain names, interacting with file systems...

How PHP Executes – from Source Code to Render

Inspired by a recent article on how Ruby code executes, this article covers the execution process for PHP code.Introduction There’s a lot going on under the hood when we execute a piece of PHP code. Broadly speaking, the PHP interpreter goes through four stages when executing code:Lexing Parsing Compilation I...

Using GDELT 2 with PHP to Analyze the World!

Are you interested in political world events? Do you want to play with one of the world’s largest databases? If you answered either of those questions with a yes, keep reading – this will interest you! This article follows up on the promise to use GDELT with PHP. I will show you a simple example of how to ...

Sourcehunt – Open Source Week Edition

Sourcehunt – Open Source Week Edition This week is Open Source Week at SitePoint.com. While we do usually cover open source here, what with all the tutorials and introductions to amazing new libraries, packages, and frameworks, this week will be a little “theoretical” for a change. We’ll discus...