Category: oddball

ReactJS in PHP: Writing Compilers Is Easy and Fun!

I used to use an extension called XHP. It enables HTML-in-PHP syntax for generating front-end markup. I reached for it recently, and was surprised to find that it was no longer officially supported for modern PHP versions. So, I decided to implement a user-land version of it, using a basic state-machine compiler. It se...

How to Scan Fingerprints with Async PHP and React Native

We live in interesting times. A short while ago, a company called OfferZen announced a new, programmable credit card. It’s been a long time since I was this excited to get my hands on a piece of tech. My mind has been brimming with ideas ever since. So, I decided to write about one of them! I’m going to des...

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...

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...

The Android Elephpant – Laravel on your Android Phone?

It was not that long ago that Christopher Pitt wrote an excellent article about writing and running PHP code on an iPad. After reading it, I thought to myself “It would be really cool to do the same on Android”: being able to write and edit code on the fly, for example while traveling, and not having to tak...

Achieving Modular Architecture with Forwarding Decorators

As your web application becomes larger, you certainly start to think more about designing a flexible, modular architecture which is meant to allow for a high amount of extensibility. There are lots of ways to implement such architecture, and all of them circle around the fundamental principles: separation of concerns, ...

How to Make Modern PHP More Modern? With Preprocessing!

Let’s have a bit of fun. A while ago, I experimented with PHP macros, adding Python range syntax. Then, the talented SaraMG mentioned an RFC, and LordKabelo suggested instead adding C#-style getters and setters to PHP. Aware of how painfully slow it can be for an outsider to suggest and implement a new language f...

Home-Made Twitter and Gmail Notifications with PHP and Arduino

I am a little obsessed with Twitter. It’s how I communicate with most of the developers I’m not fortunate to live in the same city as. I’m a little less obsessed with IoT projects, but then it’s harder to find the time to work on them than it is to check Twitter. Unless I can do both at the same...

The Delicious Evils of PHP

I want to look at two PHP functions: eval and exec. They’re so often thrown under the sensible-developers-never-use-these bus that I sometimes wonder how many awesome applications we miss out on. Like every other function in the standard library, these have their uses. They can be abused. Their danger lies in the...

How’d They Do It? PHPSnake: Detecting Keypresses

At a recent conference in Bulgaria, there was a hackathon for which Andrew Carter created a PHP console version of the popular “snake” game. I thought it was a really interesting concept, and since Andrew has a history of using PHP for weird things, I figured I’d demystify and explain how it was done...