PHP Reads - Curated PHP writing worth your time

5 min read Original article ↗

RSS Feed

"This issue is a reminder that communities grow stronger when they question, rethink, and build in public."
— Stefan & Sebastian

blog.daniil.it

Could community releases accelerate PHP?

Daniil Gentili, maintainer of Psalm, proposes an official rolling community release that would give developers early access to experimental PHP features. He argues that this might help the PHP community evolve the language even faster.

Picked by Sebastian Bergmann and Stefan Priebsch – "An interesting idea, albeit a controversial one. Discussing proposals like this is what PHP moves forward."

ilia.ws

Persistent database connections in PHP

How do persistent database connections in PHP work, and why can they boost performance? Ilia Alshanetsky, PHP core contributor and former release manager, revisits why they were considered problematic in the days of shared hosting and explains why those concerns are often manageable in modern PHP deployments.

Picked by Sebastian Bergmann – "Seeing Ilia, one of the most experienced voices in the PHP community, blogging again is a real pleasure. We'd like to think that PHP Reads helped inspire his return."

afilina.com

A community-run video platform for PHP

A new project aims to give the PHP community a community-run alternative to YouTube, focused on discovery, openness, and creator control rather than algorithms, ads, and platform lock-in. Built on PeerTube and inspired by the federated model behind phpc.social, it is intended as a more sustainable home for PHP video content and community exchange.

Picked by Stefan Priebsch – "Communities become stronger when they create the platforms and spaces they want to belong to."

RSS Feed

"This week, we take a closer look at PHP closures: how they work, how they can be used in surprising ways, and how they can influence behaviour far beyond the code they contain."
— Stefan & Sebastian

dev.to/mikevarenek

Introduction to PHP closures

If you are unfamiliar with closures in PHP or have not given much thought to how they work, this blog post provides an excellent overview of the basics. It provides an accessible introduction to the concept and demonstrates why closures are useful in everyday PHP development.

Picked by Stefan Priebsch – "Read this if you want to set the stage for the other two pretty advanced posts we have selected for you this week."

f2r.github.io

Why use static closures?

The article explains that PHP closures created inside instance methods implicitly maintain a reference to the current object, even when the variable $this is not used directly. This subtle aspect of PHP closures can affect the lifetime of objects and their runtime behaviour in ways that many developers may not expect. An improvement will be introduced with PHP 8.6.

Picked by Sebastian Bergmann – "This concise read that sharpens your intuition for how small structural choices can affect runtime behavior and code quality."

freek.dev

How to easily access private properties and methods in PHP

This post shows how easy it can be in PHP to inspect or interact with an object’s private internals when you truly need to. More broadly, it uses that example to explain an interesting aspect of PHP itself: visibility is tied to class scope, and closures can be rebound in a way that opens access without a lot of heavy machinery.

Picked by Stefan Priebsch – "We did not select this post because you should access private methods and properties, but because it demonstrates an elegant way to solve this problem using closures."

RSS Feed

Good ideas in software often appear long before the ecosystem is ready for them. What seems obvious today was often an experiment a long time ago.
— Stefan & Sebastian

thephp.foundation

A pragmatic path to compile-time generics

Compile-time generics could bring many of the benefits of generics to PHP without the runtime complexity they usually require. Restricting generics to interfaces and abstract classes and resolving type parameters during compilation is a pragmatic approach that might deliver most of the value developers want, without fundamentally changing how PHP works.

Picked by Sebastian Bergmann – "Gina and Larry have produced outstanding research that provides an excellent background for understanding the challenges of implementing generics in a dynamic language."

tideways.com

Performance improvements in PHP 8.5

The PHP performance experts at Tideways highlight several improvements in PHP 8.5. Rather than explaining flashy new syntax, their overview focuses on practical changes that help developers better understand performance behavior, diagnose issues more quickly, and run PHP applications more reliably in modern environments.

Picked by Stefan Priebsch – "The faster TLS handshake implementation is a good example of how PHP evolves through behind-the-scenes improvements that benefit developers in everyday use."

npopov.com

Cooperative multitasking in PHP

Flashback: In this article, written as early as 2012, Nikita Popov demonstrates how PHP generators (introduced in PHP 5.5) can be used to implement coroutines and build a simple cooperative multitasking scheduler.

Picked by Stefan Priebsch – "Following his early contributions to PHP 5, Nikita Popov became one of the language's most influential contributors and played a key role in making PHP 7 possible."