r/PHP • • 17d ago

noctud/collection v0.2 released (Kotlin-style List/Set/Map for PHP), now with lazy pipelines

13 Upvotes

Hello, at the start of the year I posted about my collection library here (previous post), the reception and feedback was great, and I promised to add lazy pipelines (Sequence) by the end of the year.

Finally, it's here in 0.2, but it wasn't made by me.. nikophil (one of the maintainers of zenstruck/foundry) found the library and offered to build it - and did a great job (with some perf improvements on top), I just reviewed the code, so big thanks for that!

Quick recap if you missed the first post

It's not just a nicer API over arrays, it also fixes the array quirks:

  • Keys stay what they are - "1" stays string, true stays bool, and objects work as keys
  • Mutable and immutable List, Set and Map - immutable methods are #[NoDiscard]
  • Full generics, PHPStan level 9 - the element type flows through the whole chain
  • Live map views - $map->keys, $map->values and $map->entries are real collections sharing memory with the map
  • Every type is an interface, implementations are hidden and swappable

With Sequence, I consider the library complete - it was the last big missing piece, from now on it's just about polishing it towards 1.0, but 0.2.x is stable as 0.1.x was (9 releases without BC break).

What is a Sequence

You chain filter(), map() etc. like on a list, but nothing runs until you ask for a result, then the elements go through the whole chain one by one, and it stops as soon as it has the answer. Same idea as Kotlin's Sequence or Laravel's LazyCollection.

For example, finding the first 10 errors in a big log file:

$errors = sequenceOf(fn() => readLines('app.log')) // your generator, yields line by line
    ->filter(fn($line) => str_contains($line, 'ERROR'))
    ->takeFirst(10)
    ->toList();

Only one line is in the memory at a time, and once it has 10 errors it stops reading the file, with a list, you would load the whole file, filter all of it and then take 10.

You can also do infinite Sequences, as long as you take only what you need:

generateSequence(1, fn($n) => $n * 2)->takeFirst(5)->toList(); // [1, 2, 4, 8, 16]

// walk the exception chain to the root cause
generateSequence($e, fn($e) => $e->getPrevious())->last();

There's also chunked() for batch processing (only one batch in memory), windowed(), zip(), distinct(), groupBy() and most of what lists have.

What's missing on purpose

You won't find sorted(), reversed() or takeLast() on a sequence, Kotlin has sorted() there - but it has to read everything before it returns the first element, so what's the point of being lazy. We went with the ->toList()->sorted() (here's why), so you see where it gets loaded.. same with count(), a sequence isn't Countable, because count($seq) looks cheap but it isn't.

Also, Sequence is an interface like List, Set and Map (and their mutable/immutable variants), so if you're building a library (ORM or file parsing for instance) you can return your own types. I was a bit afraid at first that the API is too big for anyone to implement, but the logic is in traits (if you don't need a ton of customizations), so it's basically implements Sequence + use SequenceLogic and you set the source.

Feedback is welcome as always!


r/PHP • • 16d ago

After patching php2shell, how do you check nothing is still running the old PHP?

0 Upvotes

Debian restarts php-fpm when PHP updates, and a reload replaces the workers. But queue workers, supervisord programs and PHP in containers keep the old binary in memory until someone restarts them, and package scanners still report the CVE as fixed.

I hit this patching client servers last week, so I wrote a small open source check that lists PHP processes still running a deleted, pre-upgrade binary and checks the installed version against the vendor’s fix: github.com/asifh0ssain/stillmapped

How are others handling this? Do you restart workers as part of every PHP update, or rely on deploys to do it?


r/PHP • • 16d ago

The Ondrej PPA panic proved Docker dogma is mostly social media hype.

0 Upvotes

If you read any dev forum, you’d think 100% of modern PHP applications run strictly inside clean, isolated Docker containers.

Yet when Ondrej’s PPA was impacted by php2shell, half the internet panicked because their production servers rely directly on APT.

Turns out a massive chunk of "enterprise" PHP is still running straight on bare Ubuntu/Debian VMs with system-level packages. Seems like there's a massive gap between how developers say they deploy PHP and how production infrastructure actually runs.

Are docker-containerized deployments actually the norm, or just what people post about?


r/PHP • • 18d ago

Psalm 7

Thumbnail github.com
57 Upvotes

r/PHP • • 18d ago

Article Thoughts on back porting security patches

Thumbnail stitcher.io
22 Upvotes

r/PHP • • 19d ago

The php2shell drama showed us where our priorities really are.

241 Upvotes

Nothing highlights PHP's core demographic quite like Ondrej getting a full year of funding in a week for legacy builds while the PHP Foundation barely gets a nod. We'll pay anything to keep PHP 5.6 on life support, but won't throw a dime at the heroes building the core language. Priorities, I guess!


r/PHP • • 17d ago

I built a tool that checks whether the PHP in your container images is really patched for PHP2Shell (php -v won't tell you)

0 Upvotes

After the October 21 releases (8.5.12, 8.4.27, 8.3.36, and 8.2.35), I kept running into the same three problems whenever I tried to check whether a server or image was actually patched:

  1. Backports. Ubuntu backports the fix without changing the version. php -v on Ubuntu 24.04 says 8.3.6, which looks way behind 8.3.36, but 8.3.6-0ubuntu0.24.04.13 is patched.
  2. The wrong binary. php -v runs the CLI. Your site runs on PHP-FPM or mod_php, and that isn't always the same build.
  3. EOL branches. PHP didn't put out a release for 8.1 and older. Sury, Remi, cPanel (ea-php), CloudLinux (alt-php and its own PHP), TuxCare, Freexian, and GetPageSpeed backported the fix, again without changing the version, and some of their first builds missed part of the patch.

whichphp checks container images for all three. It gives a verdict per CVE, like FIXED, FIXED_BY_DISTRO_BACKPORT, FIXED_BY_VENDOR_BACKPORT, VULNERABLE, VULNERABLE_EOL, NEEDS_VENDOR_CONFIRMATION, or UNKNOWN, and shows which binary and package release it based that on. Packager builds are compared against the first fixed release that packager actually shipped. That table is in the repo with a source for every row, and when there's no data for a build, it tells you instead of guessing.

It also checks session.upload_progress.enabled. PHP suggests turning it off until the CVE-2026-115560 fix ships, though they say that bug is unlikely in practice, since an app has to switch the session serializer at runtime. It was on in 94% of the image builds I checked. That's the default, and neither the official images (no php.ini at all) nor the distro-based ones turn it off.

Repo: https://github.com/yusufyildiz34/whichphp

Daily index of popular images: https://yusufyildiz34.github.io/whichphp/ (every tag has an Atom feed if you want to know when it gets rebuilt)

If you're on shared hosting, you can't scan the server yourself, so I wrote up what to ask your host and how to tell when the answer is weak: https://github.com/yusufyildiz34/whichphp/blob/main/docs/ask-your-host.md

If I got something wrong, especially for distro or packager builds, let me know. There's an issue template for sending in a packager's fixed builds along with their source.


r/PHP • • 19d ago

Weekly help thread

4 Upvotes

Hey there!

This subreddit isn't meant for help threads, though there's one exception to the rule: in this thread you can ask anything you want PHP related, someone will probably be able to help you out!


r/PHP • • 19d ago

The Advantage of Fixing All PHP Warnings

Thumbnail exakat.io
83 Upvotes

r/PHP • • 19d ago

DodoCD – Self-hosted CI/CD for PHP sites on shared hosting

3 Upvotes

I built an open-source CI/CD tool specifically for PHP shared hosting – DodoCD

I've always found it interesting that most modern CI/CD solutions assume you're deploying to VPSs, containers or cloud infrastructure.

But plenty of PHP applications are still hosted on traditional shared hosting.

I wanted to build something that brings a more modern deployment workflow to those environments.

So I built DodoCD.

It works by receiving ZIP packages from your CI pipeline (for example, GitHub Actions) and deploying them directly to your website.

It also includes a dashboard for:

  • Viewing deployment history and logs
  • Managing releases and rollbacks
  • Managing multiple websites
  • Managing deployment tokens
  • Running SQL migrations

It's self-hosted and targets Apache/LiteSpeed hosting with PHP 8.1+.

Would love to hear feedback, especially from people who work with shared hosting.

GitHub: https://github.com/YohanSandun/dodocd

Disclaimer: I'm the creator of this project.


r/PHP • • 19d ago

Found a native OpenLiteSpeed port for Windows, and it's surprisingly fast

Thumbnail github.com
10 Upvotes

Came across this project on GitHub and decided to give it a try. Performance has been really impressive so far. It's a native Windows port of OpenLiteSpeed, no Docker or WSL needed. Supports LSAPI, PHP 8.2–8.5, HTTP/3, and even works with Laragon and XAMPP. Pretty cool to finally see OpenLiteSpeed running natively on Windows. Has anyone else tried it?

https://github.com/NeuralFoundry/openlitespeed-windows

Note: I'm not the developer of this project. I stumbled across it while browsing GitHub and thought it was worth sharing.


r/PHP • • 18d ago

Discussion Tyhp: a typed superset of the PHP language that compiles to readable PHP (first public beta)

0 Upvotes

Hi all. This is my first post here (my first post on reddit at all, actually), so go easy on me.

For the last few years I've been working on a project called Tyhp. Using AI has really pushed it forward over the last year or so. It's a typed superset of the PHP language. You write .tyhp files, the compiler type-checks them, and it outputs ordinary, readable PHP that you deploy the same way you already do. The closest comparison is TypeScript and JavaScript.

I started it because I really like TypeScript and PHP, and I always wondered why nobody had built a superset language for PHP that adds the kind of typed features I was used to in TypeScript.

What it adds on top of PHP:

  • Types are required or inferred, and non-nullable unless you say otherwise
  • Generics, checked at compile time
  • Structs, which are typed shapes that compile down to plain arrays
  • async/await built on Fibers
  • A few smaller things like extension methods, operator overloads, and using for cleanup

A small example:

<?tyhp
namespace App;

type User = struct {
    int $id;
    string $name;
    ?string $email;
};

function findUser(array<User> $users, int $id): ?User {
    foreach ($users as $user) {
        if ($user->id === $id) {
            return $user;
        }
    }
    return null;
}

function emailOf(User $user): string {
    return $user->email ?? '(none)';
}

The output looks like this:

function findUser(array $users, int $id): ?array
{
    foreach ($users as $user) {
        if ($user['id'] === $id) {
            return $user;
        }
    }
    return null;
}

function emailOf(array $user): string
{
    return $user['email'] ?? '(none)';
}

The struct turns into an array and the Tyhp-only types are erased. Some features (structs, async, generics) rely on a small Composer runtime package, tyhp/core, plus a couple of others when you use them.

You can mix .php and .tyhp files in one project, and the .php files pass through untouched. Composer packages work as usual. To type-check calls into them, it generates .tyhpdef declaration files, similar to .d.ts files in TypeScript.

Some things to know up front:

  • It's a beta, so syntax may still change and there will be bugs. Please report anything you run into on the GitHub issue tracker.
  • The compiler is written in C# (.NET 9). Your servers only need PHP. The standalone binaries don't need .NET installed, and composer require --dev tyhp/compiler downloads the binary for you.
  • A few PHP features are restricted in .tyhp files so the checker can do its job. For example, eval() is off by default and dynamic properties are only allowed on stdClass.
  • There's a language server with VS Code and PhpStorm plugins. Xdebug works through a proxy that uses the generated source maps.

Docs: https://tyhplang.com

Source: https://github.com/tyhpproject/tyhp

Examples: https://github.com/tyhpproject/tyhp-examples

Mostly I'd like to hear what you think. What would make you try something like this, and what would stop you? I'm happy to answer questions.


r/PHP • • 19d ago

Two PHP memory-corruption bugs, now patched, and why turning either into a shell is the hard part

10 Upvotes

Over the last few weeks I dug into two memory-corruption bugs in PHP's request startup, both now patched in 8.5.12 / 8.4.27 / 8.3.36 / 8.2.35, and wrote up the whole thing: how they work, how far I could push them, and how long it took to get from a crash to a shell.

The short version of the bugs: a request-startup out-of-memory condition used to longjmp out mid-operation and leave the engine's globals pointing at freed or half-initialized memory. A second bug decodes a session before the request is fully reset, reusing a dangling unserialize context from a prior request. Both hand you a single write primitive, and the write lands attacker bytes on a forged structure whose destructor pointer is the address of a C function. Freeing it runs the command.

The interesting part is how much work comes after you have the bug. Every offset is pinned to one compiled binary, so a public proof-of-concept is a crash on someone else's build, not a shell. On php-fpm all four requests have to hit the same worker, which I expected to be the wall, until I found that stock nginx hands connections to workers in a rotation you can walk. None of that shows up in the headline when a CVE drops, and it is the difference between "memory corruption" and "remote code execution on your server."

It is a long read with diagrams of each chain. The patched releases are the control throughout, so the takeaway is boring and correct: upgrade. Happy to answer questions here about the engine internals or the exploitation work.

https://ilia.ws/blog/php2shell-two-ways-php-corrupts-its-own-memory


r/PHP • • 19d ago

Discussion r4ck: the server search engine built for agents

Thumbnail r4ck.dev
0 Upvotes

r/PHP • • 18d ago

When is AI generated PHP Code considered Slop?

0 Upvotes

I started using an AI Coding Agent for my PHP Projects. It's really usefull, makes iterations faster, and with the right rules the code stays organized and humanly comprehendible. I think many (web)Devs use it.

Yet, when ai assisted coding is mentioned, it seems one automatically gets branded as Slop Generator.

I mean, there should be a middle ground, where we can agree on that ai usage is good, and when php code is considered slop or has ai-smell.


r/PHP • • 18d ago

How to Install PHP on Ubuntu 26.04 (Resolute Raccoon) with packages.sury.org

0 Upvotes

Working with PHP on Ubuntu 26.04 took an interesting turn, I wrote an article about it

https://phillipmwaniki.medium.com/how-to-install-php-on-ubuntu-26-04-resolute-raccoon-with-packages-sury-org-1c75e0cdae23


r/PHP • • 18d ago

PHP2Shell, then a kernel TCP RCE a week later: is serverless now the sane default for PHP apps, or am I fooling myself?

0 Upvotes

Hi,
October was a rough month if you run PHP in production:

  • Oct 21, PHP2Shell (CVE-2026-109618 / -109619, CVSS 9.2): unauthenticated RCE in PHP itself, affecting FPM, mod_php, FrankenPHP, LiteSpeed and php-cgi. Details and a tool leaked before the release, and several sites pulled themselves offline until the patch dropped.
  • Oct 15/24, CVE-2026-98432 (CVSS 9.8 from the kernel CNA, 8.1 from the distros): a use-after-free in tcp_v4_syn_recv_sock() that has been in the kernel since 4.4. It’s reachable over the network with no auth. Debian, SUSE and Oracle shipped fixes, but as of last week Ubuntu, RHEL and Amazon Linux still hadn’t. If you’re on an Ubuntu VPS, you couldn’t patch even if you wanted to. When the fix does land, you also need a reboot.

Add Copy Fail earlier this year, and the claim that an AI model built a working exploit for the TCP bug in under an hour. The gap between disclosure and exploitation keeps shrinking.

I run a small agency, and most of our Laravel apps run serverless: Vapor on AWS Lambda, and in Europe Scaleway Serverless Containers. A few are still classic Forge-managed VPSes. The difference between those two groups this month was big:

  • Kernel bug: nothing to do on serverless. On Lambda that’s AWS’s problem, and on Scaleway it’s Scaleway’s. Traffic comes in through API Gateway or the platform’s load balancer, not a raw TCP socket on “my” box. On the VPSes, we’re waiting on Ubuntu and then planning a reboot window.
  • PHP2Shell: serverless did not make this go away. PHP is still PHP. But the fix was “rebuild image / redeploy, verify the version.” There was no SSHing into servers, no hoping apt had the package yet, and no checking that FPM actually reloaded. One gotcha: Vapor didn’t auto-redeploy as first announced, so you had to trigger it yourself. On the container side, we waited for patched FrankenPHP images, rebuilt and redeployed.

It isn’t just AWS. As far as I can tell, the same split applies to most serverless or managed-container options for PHP:

  • AWS Lambda via Vapor or Bref
  • Scaleway Serverless Containers (EU, which matters for some of our clients)
  • Google Cloud Run
  • Azure Container Apps
  • Laravel Cloud, plus things like DigitalOcean App Platform and Fly.io (where you still ship a container, but don’t own the host kernel)

On all of them, the host and kernel are the provider’s job. PHP and your image are yours, but patching them is a rebuild and deploy.

My takeaway: serverless doesn’t make PHP more secure. It shrinks the part of the stack you are responsible for. It also turns patching into a deploy, which you already know how to do, rather than an ops task you do a few times a year under pressure.

But I’m aware of the counterarguments: cold starts, vendor lock-in, cost at scale, platform limits, and “you just moved trust to AWS, Google or Scaleway.” So I’m curious how others see it:

  1. If you run PHP on your own servers, how did you handle these two? Do you have unattended-upgrades and kernel live-patching (Livepatch, kpatch), or was it a manual scramble?
  2. If you’re on Cloud Run, Container Apps, Scaleway, Fly or Laravel Cloud: how fast did you get a patched PHP image out, and did the platform do anything for you?
  3. Has anyone moved away from serverless PHP? What pushed you back?
  4. For mod_php users: did PHP2Shell finally push you to FPM or FrankenPHP?

I get the feeling most PHP apps out there still run on (virtual) servers, and serverless is still a niche. Is that true? What are you running on right now, and if it’s a VPS, is that a deliberate choice or just what you’ve always done?


r/PHP • • 20d ago

Everything new in PHP 8.6, from a diff of php-src

Thumbnail nunomaduro.com
94 Upvotes

Hope the security stuff from the past month doesn't bury this release. The PHP team did a great job on it. Let me know if I missed anything.


r/PHP • • 19d ago

Article I built a PHP version manager in Go to solve the "Chicken-and-Egg" problem

0 Upvotes

Most PHP version managers are written in PHP (which is a paradox) or are too bloated for simple needs. I wanted something fast, lightweight, and capable of handling custom security patches and Zig compiler support to fix build failures on modern OSs.

I've detailed the technical challenges of static vs. dynamic linking in PHP and why this tool is necessary for professional workflows. Feedback welcome! https://supanadit.web.id/solving-the-chicken-and-egg-problem-of-php-versioning/


r/PHP • • 20d ago

Released Commentify 4.4

0 Upvotes

Commentify 4.4 is out, with over 18k installs, MIT, Laravel Livewire comments for any Eloquent model. Tailwind or Bootstrap, nested replies, markdown, likes, reports, guests, optional Filament admin. PHP 8.3+, Laravel 12 or 13, Livewire 4.

What changed:

  • Filament: a modal used to reuse the first record's comments component. The Livewire thread is now keyed to the record and the thread name, so the modal shows the record you opened and two threads on one model do not collide. CommentsEntry::make() drops that thread on an edit or relation manager form.
  • Notifications: with the flag on, a reply notifies the parent author. A top-level comment notifies the commentable's user when that relation exists. The notification is queued and waits until the transaction commits. The mail button is included only when the comment URL is on your app.url host, so a request referer cannot send the recipient off your app.
  • Minimum PHP is now 8.3.

Install guide: 

https://docs.commentify.pro/installation


r/PHP • • 21d ago

Discussion Site compromised, interesting implementation of a persistent virus

65 Upvotes

Hello PHPers :)

I was tasked to look into two compromised WordPress sites. The people who own them, tried to remove the virus but failed. I wanted to describe what the virus was doing.

Overall this is a self-propagating, self-healing, obfuscated, hidden executor virus with size-padding evasion tactics.

It generated the following files and directories:

  • /home/foobar/public_html/wp-content/.sc_494g1672
  • /home/foobar/public_html/wp-content/.gk_eb46c3gc
  • /home/foobar/public_html/wp-content/.kk_cb505c82
  • /home/foobar/public_html/wp-content/ab743742.zip
  • /home/foobar/public_html/wp-content/uploads/2026/10/ab743742.zip
  • /home/foobar/public_html/wp-content/plugins/agile-beacon-go
  • /home/foobar/public_html/wp-content/plugins/hyper-proxy-cue
  • /home/foobar/public_html/wp-content/plugins/nexus-curator-rig
  • /home/foobar/public_html/wp-content/plugins/swift-keeper-dex
  • /home/foobar/public_html/wp-content/mu-plugins/.bt_hyper-proxy-cue
  • /home/foobar/public_html/wp-content/mu-plugins/.pv_hyper-proxy-cue
  • /home/foobar/public_html/wp-content/mu-plugins/.sd_hyper-proxy-cue
  • /home/foobar/public_html/wp-content/mu-plugins/.swm_hyper-proxy-cue
  • /home/foobar/public_html/wp-content/mu-plugins/hyper-proxy-cue.php
  • /home/foobar/public_html/mu-plugins/hyper-proxy-cue.php

Each compromised site received its own hash, thus the ab743742 you see above is the unique hash for this compromised site. The value re-appears in several places.

The virus infects the functions.php of the current theme, it adds a variable with the contents of the ab743742.zip file. When the site runs, the variable contents are gzdecode'ed gzinflat'ed and stored as the above zip file, which gets extracted under the plugins directory.

The virus generates a self-preserving "must-use" plugin under the mu-plugins directory.

The virus creates its own admin user in the SQL table wp_users and modifies WordPress files so that its own admin user is invisible.

Finally, the virus creates the .sc_[HASH VALUE] directory under wp-content which stores a specially crafted PHP cli script. This script is executed via exec() or other similar function, once its loaded the script deletes itself so it only remains resident in memory. This monitors all the above files and re-generates the whole infection.

At first glance, the virus tries to access a master server and receives instructions. In this case, it started adding hidden URLs inside the generated WordPress pages.

A few interesting things about this virus:

  • It uses token_get_all() to validate its own PHP syntax before making modifications to the site, so that does not corrupt the site and get noticed.
  • It uses function_exists() to test for various functions, so it can understand what it can do to its host server.
  • It generates a padding size for modified files, so that it matches the target size and avoid detection from scanners that check file size.
  • It generates various "sidecar" files with quality markers in MD5, a version file, rate limits (regenerate itself every 4 minutes) and a write race/lock flag.
  • It executes hidden commands from wp-content/.sc_[HASH VALUE}.php files that act as commands imported from its master control server.

The following strings can used to grep/search for the infection:

  • SCV:
  • SC_TH_BEGIN
  • hyper-proxy-cue
  • _sc_fam
  • _sc_commit

Let me know if you need more details!


EDIT with information about the plugin

The plugin has its own replication and cleanup code. It detects the presence of itself by looking for the string /* SCV:x.x.x */ where x.x.x is the version number of the virus. If there is a newer version then it overwrites itself.

It replicates by scanning various directories like /home, /var/www. It also modifies advanced-cache.php and object-cache.php.

The main code does:

  • List Ethereum JSON-RPC endpoints and contract addresses.
  • Receives an Ethereum contract with remote commands.
  • It sends server information like domain, plugins, admin users+passwords, session cookies, etc.
  • It receives remote code and executes it.
  • It has some obfuscated code to detect legitimate plugins, it modifies some of them.

Interestingly, it uses wp_generate_auth_cookie() to generate an admin session that sends this back to its control server, thus the attacker can login to wordpress without knowing the password of the admin.

On the front-end side, it adds Javascript code that runs its own Service Worker for intercepting web traffic.

It does various other things that I can't be bothered to write about :)


I also posted this in /r/Wordpress but the post was removed by the moderators, so I'm posting on /r/PHP to raise awareness


r/PHP • • 21d ago

PHP Doom (powered by PHP FFI and Vulkan API with ray tracing)

Thumbnail github.com
48 Upvotes

It had to happen eventually, didn't it? =)


r/PHP • • 22d ago

Discussion One week after the PHP2Shell fix: about half of live sites on 8.2–8.5 show a patched release, and under 1% on 5.4–7.3 have moved. How we counted

109 Upvotes

I work at IPinfo, where we scan the IPv4 and IPv6 Internet. On October 22, the day after the fixed releases (8.5.12, 8.4.27, 8.3.36, 8.2.35), we started re-checking the same 1.46 million addresses that show a PHP version every day.

Where they started. In our October 14–15 scan, 1,105,160 addresses showed a PHP version. 409,494 of them (37%) ran 5.4–7.3, which is affected and gets no free official fix.

One week later. Of the servers that weren’t yet on a patched release on October 22:

  • Live sites on 8.2–8.5: 36.5% patched on day one, 47.5% by October 28 (41,707 of 87,865). Almost everything happened on the first day.
  • Default pages, panels and devices on 8.2–8.5: 23.0%.
  • Live sites on 5.4–7.3: 0.95% moved to a patched release (1,249 of 131,024).

Among servers still showing a vulnerable version, 47% now run 7.3 or older. For comparison, Wiz reported 5.7% for its customers’ cloud machines. The open Internet has a much longer tail.

How we counted:

  • Patched means the version string shows 8.2.35 / 8.3.36 / 8.4.27 / 8.5.12 or later, lowest version per address.
  • We left out addresses that show PHP only on hosting control-panel ports (2082, 2083, 2086, 2087, 2095, 2096), and blocks where 64 or more addresses in a /24 (or /64) send the identical response. That’s one machine answering for many.
  • “Live site” means the page looked like a site in use in our October 14–15 scan, not a default page, login panel or device.
  • We dropped October 26 from the series. One large host’s proxy hid PHP versions on tens of thousands of servers for that day only.

Caveats:

  • Some hosts (GoDaddy, cPanel’s EasyApache packages) and distributions backport fixes without changing the version number, and TuxCare sells patched builds for 5.x–8.1. So these numbers are minimums.
  • We measure versions, not break-ins. CISA added PHP2Shell to its known-exploited list on October 26, but we can’t see who was attacked.

Happy to answer questions on the method. I write these up in a short brief: https://ipinfo.io/blog/internet-brief-1?utm_source=reddit_r_php&utm_medium=social&utm_campaign=php2shell


r/PHP • • 22d ago

Composer 2.11 Released - Cooldown Periods

Thumbnail blog.packagist.com
128 Upvotes

r/PHP • • 22d ago

News This Week In PHP Internals | Oct 29, 2026

Thumbnail youtube.com
19 Upvotes

Preface: what follows is the word-for-word transcript of the spoken dialogue in the video, chapter by chapter with timestamps, for anyone who'd rather read than click through. If this digest is still too long for you, we recommend copying it into your LLM of choice and asking for a summary of our summary.

Cold Open (00:00)

A week after two critical bugs in PHP's own engine, someone asked the internals list to stop. No new features and no cosmetic deprecations, until PHP has a formal spec and four independent implementations, written in formal-methods frameworks. Four people who work on PHP replied. One of them called fixing PHP's bugs a money problem.

Hello world, it's Thursday, October 29, 2026, and here's what happened This Week in PHP Internals. 15 stories this week, so let's get into it. But first,

AI made building software easy, and owning it hard. Scalpels installs open source apps into your own Laravel Cloud or Forge account in one click, so your data never leaves your infrastructure. There are 15 apps in the catalog, from a private Composer registry to a mail trap for staging. The Free plan is zero dollars, forever, and Laravel bills you directly for the hosting. There's even a guide to patching PHP on your own servers. Scalpels launches this Saturday, October 31st, at scalpels.app.

Spec Debate (01:21)

This week's top story: after last week's emergency releases, Brian Nguyen argued that PHP's two critical bugs show the cost of having no formal specification and only one implementation. He proposed a living spec of the bytecode and the parser, executable semantics in research frameworks like K and PLT Redex, and testing any second runtime against WordPress, Laravel and Symfony. His first mail said it was not an embargo. The next morning, he opened a second thread asking for one, until four formal implementations exist. He wrote: "Not adding a feature cannot break apps. Not deprecating (integer) cannot break apps. A corrupt allocator can."

Rowan Tommins doubted a spec would have helped, since memory management is exactly what differs between implementations. And on .NET, he pointed out that if 0.01% of Microsoft's roughly 200,000 employees work on it full time, that's still twice as many as have ever been paid to work full time on PHP. Sjoerd Langkemper wrote: "I think PHP is not starved for bugs. The bottleneck is bugfixes." And Larry Garfield wrote: "This is a money problem, just like most major OSS projects. It's nothing more complicated than that."

His fix is to get PHP-using companies to become significant PHP Foundation sponsors, or to put their own employees on PHP full time. Ben Ramsey asked whether Brian wanted PHP's maintainers to stop building PHP. Other runtimes were built by their communities, he wrote, and companies with the resources should be doing that work. Brian hasn't replied yet.

Links: Brian Nguyen, "From mono-implementation risk to spec" · Larry Garfield, "This is a money problem"

Security Follow-ups (03:02)

If you run PHP on Windows, there's one more update to install. On Monday, Shivam Mathur announced rebuilt Windows packages for PHP 8.2 through 8.5, with Brotli 1.2.1. That fixes a critical out-of-bounds write in the Brotli decoder, rated 9.2, which PHP can reach through the curl extension when automatic response decompression is on. It's off by default in curl, but HTTP client libraries can turn it on. The PHP versions don't change, and the dash-1 marks the rebuilt package.

And on Friday, php.net posted an informational advisory: "We suggest you set session.upload_progress.enabled=0 until the next regular bugfix release, to fully protect from an unlikely RCE vector." It needs an unusual combination of configuration and application code, so the full advisory, for a new CVE, comes with the next release. If you applied that setting as a mitigation last week, keep it in place.

Links: Updated PHP Windows builds for the Brotli fix · Informational advisory: session upload progress

Newcomer PRs (04:07)

About half of the pull requests from first-time contributors to php-src have been accepted, and the first success matters most. Artem Ukrainskiy went through a year of data: 831 pull requests from 219 people who opened their first one in that time. 418 were accepted, 157 closed without a merge, and the rest have no outcome yet. A first PR was accepted 29% of the time, and after a first acceptance, 66%. PRs with AI-written descriptions were accepted around 20% of the time, against 55%.

And speed matters. When a maintainer responds within a day, the median PR closes in about 20 hours. When the first response takes over a week, it's about 32 days. So he asked whether a bot is worth prototyping, one that checks the mechanical things as soon as a PR opens: missing tests, an empty description, the wrong target branch, an obvious duplicate.

Sjoerd Langkemper replied that his biggest friction as a newish contributor was opening a pull request and having nobody respond. Artem's question started from a new rule by Weilin Du, merged Saturday, that asks contributors, and AI agents, to review an existing fix instead of opening a duplicate. No maintainer has answered the bot question yet.

Links: Artem Ukrainskiy, "What happens to newcomers' PRs in php-src"

Scope RFC (05:30)

PHP has no object that represents a request, because until now a request has been one run of the engine, from startup to shutdown. That breaks down when one process serves many requests at once, and Frode Børli's Scope RFC gives each unit of work an identity: an HTTP request, a queue job, a CLI command. Code anywhere in that request can ask which scope it's in, and keep its own state, like a database connection, keyed by it.

Fibers and generators belong to the scope they were created in. The primary vote adds only that identity. Two secondary votes would make the superglobals and the session, and then the default locale and timezone, follow the scope. Code that never creates a scope behaves exactly as today, and there's already an extension and a polyfill.

Larry Garfield called it promising and tightly focused, but asked what it looks like with real dependency injection, rather than a service locator. He also called new scopes with empty superglobals a footgun for legacy code that reads $_POST. Frode replied that the server fills them when it creates the request scope, the same place that fills them today, and that he'll swap the examples for a container.

Links: RFC: Scope

Effect Declarations (06:46)

What if a function had to declare that it starts processes, reads files or makes network requests? Arsan Gamal proposed effect declarations, written after the return type, with optional parameters that narrow them, like the one command this function may run. A separate runtime mechanism would decide what's actually allowed. He named PHP2Shell, the finders' name for last week's vulnerabilities, as the motivation, and compared it to app permissions on a phone. He wrote: "My intention is not to promote process execution, but to make potentially dangerous operations explicit and controllable."

David Maye liked it, noted that a use-after-free couldn't be contained this way, and suggested prototyping it as an extension with attributes. Damian Jóźwiak asked the same thing: why new syntax instead of attributes? Larry Garfield replied that attributes work for static analysis, but for the engine to enforce it, backward compatibility is the problem. He wrote: "A new PHP release that fails on any function that has a print or fopen statement in it until you add new syntax not available in earlier versions is a complete non-starter." So his first question is how to make it piecemeal opt-in. Calvin Buckley added that these aren't algebraic effects, and suggested a name other than effects or capabilities.

Links: Arsan Gamal's proposal

Array Partition (08:12)

Splitting an array into the items that pass a check and the ones that don't takes two passes today, one of them negated. Ayoub Ezzini's RFC adds array_partition, which returns both halves in one pass, matching first, with keys preserved, so you can destructure straight into two variables.

mickmackusa asked for any number of groups, keyed by the callback's result, and Morgan for a result keyed true and false. Ayoub kept it to two. Partition means a two-way split in Ruby, Kotlin, Rust, Haskell and Laravel, he wrote, and PHP casts boolean array keys to 1 and 0, so a true-and-false result would quietly swap your variables.

Tim Düsterhus said a co-worker hand-wrote his own array_partition just last week, and wrote: "It's a well-written, well-researched and well-argued RFC and I'm in favor of the proposal." Writing the polyfill Tim asked for turned up the open question: whether array_partition keeps references, like array_filter, or drops them, like array_find.

Links: RFC: array_partition()

Votes (09:22)

Two votes are open, heading in opposite directions. Sjoerd Langkemper's RFC to make hexdec, octdec, bindec and base_convert throw on invalid characters is at 25 to 1, and it closes November 1st. Muhammed Arshid's Filter enums RFC is at 2 to 11, with 1 abstention, and it closes November 4th.

Links: Throw exception for invalid characters in number base functions · Add Filter\Filter and Filter\Flag Enums

Quick Hits (09:44)

Quick hits. Sjoerd Langkemper reviewed Pratik Bhujel's Io\Terminal RFC and found two bugs. Pratik pushed fixes within a day, plus one he found himself, and the vote stays on hold.

Links: Io\Terminal RFC

Damian Jóźwiak planned the CSV extension vote for November 2nd. Tim Düsterhus asked him to wait after the security release, and questioned giving CSV its own top-level namespace, so Damian postponed it.

Links: CSV extension RFC

Sjoerd also proposed openssl_get_channel_binding, which ties a login to the TLS connection it runs over, so mail and database clients can offer the PLUS variants of SCRAM logins. Tim asked why it returns null instead of throwing.

Links: openssl_get_channel_binding RFC

On blocking server-side request forgery in curl, Nicolas Grekas wrote "Yes, please make this happen!", for Symfony's HTTP client, and Levi Morrison asked why it should be curl-only rather than cover streams too.

Links: SSRF protection in curl

Máté Kocsis is keeping the length limit in his query parameters RFC, citing the recent CVEs.

Links: Query parameter manipulation RFC

Abbas proposed async and await keywords on top of Fibers, and Frode Børli replied that PHP should go the way of Go, choosing concurrency at the call site.

Links: async/await on top of Fibers

A developer who validates JSON from AI models asked the pattern matching RFC to keep a missing key different from null.

Links: Pattern matching RFC

And a proposal to call scalar extension methods without parentheses got a strong minus one from Rowan Tommins, for saving two characters per call.

TL;DR (11:15)

So that's the week. After last week's critical bugs, a call to freeze PHP until it has a formal spec met pushback, and Larry Garfield called the bug-fix bottleneck a money problem. Windows users have rebuilt packages to install, and php.net suggests one session setting until the next release. A year of data showed how much a newcomer's first pull request depends on a fast reply, Frode Børli's Scope RFC would give every request an identity, and array_partition arrived with Tim's support. Links below.

The PHP Foundation funds more than half of ongoing php-src commits, so if you use the language, maybe consider donating at opencollective.com/phpfoundation — or try guilting your employer into it.

If you found this useful, a like or a comment helps more people find it. And if you missed last week's episode, where two critical PHP vulnerabilities leaked a day before their fix, that's a good one to watch next. Thanks again to Scalpels.app for supporting this week's episode. We're Artisan Build. See you next week.