Using a vector database with PHP PHP has roughly 80 array functions: eight – zero. array_map, array_walk, array_reduce,array_filter, array_each… wait, that last one was deprecated and removed in PHP 7.2. Or not? And some new functions came up in PHP 8.5, last november. The real problem is discoverability. You know the task, “find the first […]
Types and Tests: Not Rivals, Just Working Different Shifts A common source of confusion in PHP development is the relationship between static analysis and unit testing. Are they redundant? Does adding types mean fewer tests? Does a comprehensive test suite make a type checker unnecessary? No to all three. They cover different grounds. The interesting […]
php-typos: A Fast Spellchecker for PHP Codebases (Tool Review) There’s a particular kind of embarrassment reserved for the typo that ships to production. A recievePayment() method. A config key spelled treshold. A comment that confidently explains the “lenght” of an array. None of it breaks anything, all of it makes the codebase look a little […]
Putting PHP’s M_EULER to Work PHP ships with more mathematical constants than most developers ever use. One of the most overlooked is M_EULER, which is the Euler constant. So, before putting PHP’s M_EULER to work, we need to clear up a confusion with another Euler constant in PHP: M_E. M_E vs M_EULER: Two Constants, Two […]
Also PHP: A Curated Watchlist for the PHP Ecosystem PHP runs more of the web than most people admit. And yet, when a new developer tool ships — a security scanner, an AI code assistant, a code counter, a refactoring engine: PHP support is often an afterthought, a footnote, or simply missing. Also supports PHP […]
Five Ways to Write a PHP Type PHP’s type system is grown up. PHP 7.0 started the ball rolling with parameter and return types. PHP 7.4 added property types. PHP 8.3 added the class constant types, though we’ll omit this for now. PHP has quietly accumulated five distinct syntaxes where you can write something that […]
PHP and AI: What Actually Exists at the Language Level PHP runs about three-quarters of the web, and yet whenever AI comes up in conversation, PHP is the friend who wasn’t invited to the party. The received wisdom is that AI belongs to Python and that PHP developers are limited to politely calling someone else’s […]
The turbofish meet the elephpant: 🐟 Somewhere, probably on an infinite step of grass, the turbofish meets the elephpant. You’ll need imagination to picture that, for sure, but by November, you’ll probably have it in your reality. So, what is this new fish, and what does it have to do with generic types? Let’s take […]
Filtering Empty Arrays Before array_merge()? Picture this: you’re looping through something, calling a function each time. It always returns an array, and, sometimes it gives back an empty array. At the end, all these array will be array_merge(…$results) together. The first point is to avoid array_merge() inside the loop, as it is one of the […]
Testing regex with reverse generation I had a regex once that passed 37 hand-written tests. First fuzz run found a crash in 200ms. That’s what this post is about: testing regex with reverse generation using pointybeard/reverse-regex to generate strings guaranteed to match a regex, so you can test your validation code against inputs you didn’t […]
The Empty String in PHP: One Value, Too Many Jobs The humble empty string “” is everywhere. It’s the quiet default, the silent failure signal or the silent success signal, the lazy cast, the natural accumulator. Behind the obvious simplicity of the empty string in PHP lies a surprising amount of overloaded meanings, which leads […]











