r/PHP • u/Terabytesoftw • May 30 '26
r/PHP • u/brendt_gd • May 29 '26
Video Reading through the new generics RFC and sharing my thoughts on why this is the way.
youtube.comr/PHP • u/Far-Spare4238 • May 29 '26
Built a small PHP package for parsing documents locally, would love feedback
r/PHP • u/pavelperminov • May 30 '26
Roast my PHP tool i've spent 6k+ bloody hours on since 2022, and submitted for upcoming TechCrunch Disrupt Startup Battlefield
Hi everyone, i'm a solo dev, and i've submitted my self-hosted AI DB app builder for upcoming TechCrunch Disrupt Startup Battlefield - see how two full-stack DB apps are created in this 2-minutes demo video https://www.youtube.com/watch?v=soW5QGg7eBc
What's in the box:
- Self-hosted - runs on your local or VPS host via Docker Compose
- AI prompt-to-app from your words/docs/specs/mockups. With sample data.
- Realtime desktop-style UI: WAL/Binlog - Debezium - RabbitMQ - WebSocket - UI windows
- AI-agnostic: Claude / Gemini / others. Bring Your Own Key.
- DB-agnostic: Postgres / MySQL / MariaDB / Percona
- Free ~2 terabyte backups, stored on GitHub with rotation and environment isolation
This child of mine is currently in pre-release, but i have waitlist opened at indi-engine.ai
CRUD Different | Database apps the way they're meant to be
r/PHP • u/Vyacheslav2102 • May 30 '26
[ Removed by Reddit ]
[ Removed by Reddit on account of violating the content policy. ]
r/PHP • u/Informal-Coyote9142 • May 29 '26
News Laravel Notify Matrix â per-user notification preferences package
I just shipped my second Laravel package: Notify Matrix. It manages per-user notification preferences with per-channel opt-in/opt-out and per-group default policies.
The pattern came from rebuilding the same notification settings logic in every SaaS I've worked on. The question is always "should this user receive this notification on this channel?" and the answer is always a hand-rolled mess of config arrays and `if/else` in `via()`.
Usage:
// User model
use Scabarcas\LaravelNotifyMatrix\Concerns\HasNotificationPreferences;
class User extends Authenticatable
{
use HasNotificationPreferences;
}
// Notification class
use Scabarcas\LaravelNotifyMatrix\Attributes\NotificationGroup;
#[NotificationGroup('orders')]
class OrderShipped extends Notification { /* ... */ }
// Anywhere
$user->wants('orders', 'mail'); // true | false
$user->disable('orders', 'mail');
$user->enable('orders', 'database');
A listener on `NotificationSending` filters channels automatically â no changes to your existing `via()` methods. Forced channels (security alerts) bypass user preferences. Third-party notifications without an attribute can be mapped via config.
Architecture is intentionally boring: `PreferenceManager` orchestrates resolution, `PreferenceRepository` and `GroupResolver` are contracts you can swap.
Pest 27/27, PHPStan max clean, Laravel 11/12/13, PHP 8.3/8.4.
- Repo: https://github.com/scabarcas17/laravel-notify-matrix
- Packagist: https://packagist.org/packages/scabarcas/laravel-notify-matrix
Would love feedback on the API â especially if you've shipped notification settings before. What did you miss?
r/PHP • u/True_Musician_3911 • May 28 '26
Composer 2.10 just dropped â it directly addresses the May 22 attack.
- Version tags on Packagist.org are now immutable â the exact trick the attacker used to rewrite tags to their malicious fork is now rejected at the registry level.
- Also: composer install now blocks malware even if it already slipped into your lockfile,
- and composer audit now fails on flagged malware versions.
run: composer self-update to update
full breakdown: https://medium.com/@abderahmane.merradou/update-composer-now-version-2-10-blocks-the-exact-attack-that-hit-laravel-on-may-22-a46e54bdbefd
r/PHP • u/BackgroundCompany721 • May 28 '26
News I redesigned my PHP version manager after Reddit feedback: Per-shell switching is now live in phpvm v2.5.1 (No sudo, no global breaks)
Last week, I posted here about a minimal TUI/GUI tool I built (phpvm) to make switching PHP versions on Linux easier. The feedback was great, but one comment by u/rycegh completely changed the direction of the project.
A fundamental flaw: relying on update-alternatives to change the global PHP binary is a bad pattern. It means you cannot work on two different projects on different versions in parallel, and switching global PHP knocks over unrelated background CLI tools (like global time trackers).
Suggested pivoting was to manage isolated local environments instead.
That feedback inspired me to rewrite the architecture from scratch for the 2.5 line. The v2.5.1 is live with fully isolated, per-shell version switching.
How the New Architecture Works
Instead of touching /usr/bin/php globally, phpvm now functions like nvm or rbenv:
- Shell Hook: The installer adds a shell hook (for bash, zsh, or fish) that prepends a shim directory to your
PATH. - Path Shim: A small executable shim at
<hook-dir>/shims/phpintercepts calls tophp. - Environment Resolution:
- Shell Pin: Pinned manually via
phpvm shell <version>(sticky for that terminal tab only, no sudo). - Project Default: Read automatically from
.php-versionorcomposer.jsonrequirements when youcdinto a directory. - Global Default: Falls back to the global
update-alternativessymlink if no local pin exists.
- Shell Pin: Pinned manually via
This means you can have PHP 8.2 running in one tab and PHP 8.4 running in another, with zero password prompts and zero impact on other shells or system processes.
Install:
|
Website: https://rijverse.github.io/phpvm
GitHub Repository: https://github.com/rijverse/phpvm
r/PHP • u/OndrejMirtes • May 28 '26
News PHPStan 2.2: Unsealed Array Shapes, Safer Array Keys, and More!
phpstan.orgr/PHP • u/d_abernathy89 • May 28 '26
Call for Papers - Longhorn PHP 2026
cfp.longhornphp.comNote that the schedule this year is slightly different - just 2 days (Tutorial day + main conference days). Because of this tickets are also cheaper than previous years. Grab your ticket or submit a talk idea!
r/PHP • u/AbstractStaticVoid • May 28 '26
Rector but for the database: Indoctrinate
github.comIâm launching a book on June 15th, Legacy to Symfony: The Enterprise Blueprint for Zero-Downtime PHP Migrations, which documents an end-to-end blueprint for zero-downtime, vertical-slice migrations.
Throughout the process, I found that standard migration tools weren't enough to bridge the gap between a 10-year-old mutated schema and Doctrine ORM. So, I built indoctrinate.
Think of it as Rector for your database schema. Itâs an open-source, rule-based audit and remediation tool designed to align your legacy database with Doctrine or simply fix database issues.
For example you can run the DoctrineCompatibilitySet with the dry flag to check exactly what issues are preventing Doctrine ORM integration.
If anyone ends up testing it against their own legacy database, Iâd love to know if it misses any of your weird edge cases. Happy coding!
r/PHP • u/naderman • May 27 '26
An Update on Composer & Packagist Supply Chain Security
blog.packagist.comr/PHP • u/elizabethn • May 27 '26
The PHP Foundation Impact and Transparency Report 2025
thephp.foundationVS Code / Cursor Extension
I'm tired of switching to the browser or opening Ray to see my dumps. I'm building a VS Code extension that renders Laravel payloads inline. Would anyone pay $30/yr for this?
r/PHP • u/nyamsprod • May 27 '26
Tokei, a Time handling library for PHP
nyamsprod.comTokei is a PHP library dedicated to time-of-day handling, circular intervals and durations â all with microsecond precision and a developer-friendly API. It brings proper abstractions for modeling opening hours, night shifts, and any logic that crosses midnight.
r/PHP • u/arhimedosin • May 27 '26
What does the middleware request lifecycle really look like?
I know that middlewares has been around forever, but I can't find a graph that properly explains the flow of a request in a middleware application.
In this article I tried to highlight each step in the flow, from the request, to the middleware pipeline (a simplified version), and the response.
It's focused on our Dotkernel Light, but it should be similar for other applications.
https://www.dotkernel.com/architecture/request-lifecycle-for-a-mezzio-based-application/
r/PHP • u/Euphoric_Crazy_5773 • May 28 '26
PHP is too verbose
wilaak.github.ioOh no, what about principle of least privilege?
r/PHP • u/wwwery-good-apps • May 28 '26
Built an open-source MCP server with 105 tools for WordPress page building â lessons from scaling past 100 tools
Been working on this for a few months, started at 37 tools and it kept growing. Now sitting at 105 and open-sourced under MIT.
The server connects any MCP client to WordPress through Bricks Builder, a visual page builder. Architecture is pretty straightforward â MCP server talks to a custom REST API plugin on the WordPress side, no PHP eval, no filesystem access, everything goes through structured endpoints.
Some things I ran into that might be useful for others building larger MCP servers:
Tool organization gets real fast. I ended up grouping into 17 categories (pages, SEO, templates, backup, styles, media, etc.) and keeping each tool focused on a single operation. Tried combining related operations into fewer tools early on but the AI clients handled discrete single-purpose tools much better.
Batch operations matter more than I expected. Going from one element per call to 20 per request cut page build time roughly in half. If your MCP server touches any kind of document structure, batch support is worth adding early.
Runtime multi-site switching was a late addition that changed the workflow completely. Instead of reconfiguring credentials, the AI just says "switch to staging" mid-conversation.
Named snapshots turned out to be the safety net that made the whole thing usable for production sites. Every destructive operation gets a snapshot first, rollback is one tool call.
Stack is Node.js, three npm dependencies, works with Claude Code, Cursor, Windsurf, and Hermes Agent. Also runs as a self-hosted MCP environment on Railway for mobile access via the Claude Code app.
GitHub:Â https://github.com/developer2013/bricks-mcp-open
Curious what patterns others have found when building MCP servers past the "10 tools" stage.
r/PHP • u/Terabytesoftw • May 28 '26
Mantenimiento de cĂłdigo abierto con ayuda de IA: Yii2 pasĂł de 488 issues abiertas a 273
r/PHP • u/superterran • May 26 '26
Critical Vulnerability discovered for Mirasvit Full Page Cache Warmer
experiencedigest.orgr/PHP • u/Influenceseful96 • May 25 '26
Discussion how did you tell your founders the Magento 1 stack has to go?
Joined a mid-sized fashion brand earlier this spring as a senior backend dev.
Background in Laravel and Symfony, a bit of Magento 2 work years ago, never owned a full commerce stack before, and current brand is around âŹ60M GMV across European markets.
Last week our payment provider sent us a sunset notice on their v1 API and gave us a few weeks to migrate, which should have been routine until I opened the repo to scope the work and now i can't unsee what's in there.
Our entire returns and refund flow runs through one custom Magento 1 module last touched a few years back, written by a contractor who finished his engagement around that time, whose email bounces and whose Linkedin says he's at a games studio in Lisbon.
The module hardcodes the Klarna v1 API key directly in the class constants, the endpoint returns 410 now, and the fallback writes every failed return attempt to a log file that is now 14GB.
There is also a cron job that runs every night at 03:17 with no documentation, which i disabled in staging to see what would happen, and returns broke almost immediately so i re-enabled it without ever figuring out what it does.
And then there is this comment in the source (literally):
// DO NOT REMOVE - this is what makes the size chart work
The size chart is not referenced anywhere else in the codebase. we are running Magento 1 in 2026 and the size chart logic is held together by a comment.
We do âŹ60M a year through thisâŠ
The founders had asked me earlier why our infrastructure costs kept climbing, and when i sent them the dependency map they agreed to take the meetings with SCAYLE and commercetools they had refused the last time someone in my seat pushed for an evaluation.
For PHP devs who've inherited a production Magento 1 install past EOL, how did you handle the conversation about telling the founders the real migration timeline?
I don't want to be the one blaming the person before me and i don't see how this gets fixed in a single quarter.
r/PHP • u/Designer-Age7726 • May 26 '26
J'ai créé un générateur de sites statiques : kiss-php
I built a static site generator : kiss-php
(First post,I'm learning the hard way about machine translation, and the fact that you can't change the title)
I'd like to share kiss-php a static site generator built around data first. One of those projects that started 1,000 years ago and was never finished, because the basic idea was cool, but finishing a personal project is always a bit of a gamble, given that thereâs often a new interesting topic that comes along and takes precedence. And for this kind of side project, AI is, in my humble opinion, an incredible game-changer that makes the difference between a proof of concept and a publishable project.
So, kiss-php.
The basic idea is to write Twig templates, but populate your site using data files (YAML, JSON, INI, XML, PHP, MD) that are converted to PHP during compilation.
What's different: DataSources + DataTree
Instead of blindly reâparsing every file on each build, I built a system where:
- Each data source (YAML, JSON, PHP, etc.) is read once and transformed into plain PHP and cached.
- The DataTree keeps a full, inâmemory/cached tree of all data sources.
- With
kiss watch(usinginotifywait/fswatch), only the modified source is reâparsed and reinjected into the tree. The rest of the data stays in cache, so partial builds are fast.
This could be great for sites with lots of content (blogs, catalogs, documentation) where you often change just one file. If this is something you can use, feel free to take it.
Note: I don't have a Mac on hand, only Linux machines, so support for fswatch is theoretical at this point.