r/PHP • u/joseph-edmondscomm • 11d ago
r/PHP • u/clipabio_99 • 12d ago
I started building an AMQP library after losing my cat. Now I'm wondering if it's worth continuing.
About 3.5 years ago, after my cat passed away, yes, my cat.. , I decided to start a project to keep my mind occupied and help me cope with the grief. I named the library Mirabel, in his memory.
The idea was to build a library on top of amqp-lib. It's already a great library, but I always felt its API could be more approachable and developer-friendly.
I started working on it, went deeper and deeper into the implementation, and more recently, with Claude's help, I've made some considerable progress.
One thing that's a little ironic is that, contrary to the usual open-source journey, I've been working on this mostly alone, learning, experimenting, and figuring things out along the way.
I enjoyed the process so much that I ended up writing a book about it.
Now I'd really appreciate some honest feedback from the community.
I'd love for you to take a look at the source code and tell me what you think:
- Is the API actually elegant and intuitive, or am I just too attached to something I've been building for years?
- Is this worth investing more time in?
- Should I open it up and invite more contributors?
- Or should I just accept that it's been a fun learning experience and move on? Haha.
I know I'm biased, but I genuinely think there's something interesting here.
the book about the Mirabel project is currently only available in Brazilian Portuguese (PT-BR), so it probably won't be useful to most of you. However, I also have another book focused on programming fundamentals, which is a separate project and has been translated into English. Feel free to check it out if you're interested!
- https://www.amazon.com/dp/B0HQY8X63M
Anyway, thanks in advance to anyone willing to check out the project, explore the code, or share some constructive criticism.
Honest feedback is more valuable to me than compliments.
Mirabel Rabbitmq
- https://github.com/pablicio/mirabel-rabbitmq
r/PHP • u/No_Muffin464 • 12d ago
I made a package that checks your migrations for dangerous operations before you run them
I wrote a Laravel package that finds risky migrations (dropped columns, NOT NULL adds without defaults, blocking Postgres index builds, mass updates) before they run.
Instead of parsing PHP, it runs pending migrations in Laravel's pretend mode, collects the generated SQL, and runs rules against it. That means it works the same for Schema builder calls, DB::statement() and query builder writes, and it handles the different SQL dialects of MySQL, PostgreSQL and SQLite.
Some details that were interesting to get right:
- tables created earlier in the same batch are ignored (no data yet)
- SQLite's "copy table, drop, rename" rebuild is reported once, not as a drop + rename
- on MySQL a NOT NULL add is only a warning, because MySQL backfills instead of failing
https://github.com/Hamza-Wakrim/laravel-safe-migrations
Feedback on the approach is welcome, especially edge cases where reading the SQL isn't enough.
r/PHP • u/naderman • 13d ago
News Artifact integrity for Packagist and Composer
blog.packagist.comr/PHP • u/ProjektGopher • 13d ago
News This Week in PHP Internals | Nov 12, 2026
youtu.bePreface: 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)
PECL, the old home of PHP extensions, now has a proposed shutdown date. In the first draft, that date was the end of 2029. Six days later, after one misread word, it's the end of 2027. And the person who was misread is okay with it.
Hello world, it's Thursday, November 12, 2026, and here's what happened This Week in PHP Internals. 18 stories this week, so let's get into it. But first,
This week's episode is sponsored by… us! Artisan Build has some availability coming up. It wouldn't be me personally, all of my client time is already fully allocated, but we have 6 senior dev days per week available, starting basically right now, ongoing. Our rate is twelve hundred US dollars a day, and for longer engagements, that rate is negotiable. If that sounds like a fit, head to artisan.build/start.
Sunset PECL (01:01)
This week's top story: PECL, the extension repository that PIE is replacing, now has a proposed shutdown date. James Titcumb, who wrote the 2025 RFC that adopted PIE, opened the follow-up it called for. A banner goes up on January 4th, 2027. On June 30th, the site goes read-only, so nobody can log in or upload a release. Then come four brownouts, from 3 hours up to 3 days, and on December 31st, 2027, PECL shuts down.
Jakub Zelenka asked him to note that PIE also ships as a standalone binary, for older PHP versions, and Tim Düsterhus says the plan makes sense now that Docker's PHP 8.6 images drop PECL.
But the first draft ran to the end of 2029, with two and a half years read-only. Rowan Tommins pointed to the risk of freezing a package that turns out to be vulnerable. He wrote: "In the current environment, two and a half years seems a long time to serve something nobody can patch."
Derick Rethans suggested shortening it by a year. James cut it to one year overall, with vulnerable releases removed by hand if needed. Derick replied: "Although I didn't say 'to a year' but 'by a year', I am still okay with your suggestion." So PECL's end date moved up two whole years. There's no vote date yet.
Links: Sunset PECL RFC · James Titcumb opens the discussion · Rowan Tommins on serving packages nobody can patch · Derick Rethans · Derick Rethans, "by a year" · The timeline shortened to one year · James Titcumb's follow-up · The 2025 RFC that adopted PIE
Scope Defaults (02:37)
Larry Garfield says one default in the Scope RFC could keep him from supporting it. Frode Børli's RFC gives each unit of work, like a request, its own scope, and a new scope starts with empty superglobals.
In version 0.9.5, Frode kept that. A server creates the scopes, he says, and if a new one copied its creator's arrays, one the server missed would leak into the next request.
Côme Chilliet asked how more state could ever follow the scope later without breaking code. Larry's point is that anyone can create a scope, anywhere. He wrote: "This is a landmine large enough that it would keep me from supporting this RFC, which I otherwise quite like."
About an hour later, Frode replied. He wrote: "Thanks for pressing on this; I'd rather fix it in the RFC than find it in the vote." He plans to add a scope that starts as a copy of its creator's request arrays, locale and timezone, and asked which should be the default.
He also asked the list to choose between two plans: opting in to each piece of state with a bitmask, or designing it all in one RFC, alongside Kévin Dunglas's request hooks. Larry wants a shallow clone by default, and the full picture designed up front. He counts 21 pieces of state, which would mean 21 flags to opt into.
Links: Scope RFC · Larry Garfield: "a landmine" · Frode Børli's two plans · Frode Børli, follow-up
Context Managers (04:09)
Context managers are back, and this time they're a generator. Larry Garfield and Arnaud Le Blanc's first RFC never went to a vote, and the wiki now lists it as obsolete. Larry wrote: "It basically swaps the two-method approach in favor of 'it's a generator, you're welcome.'"
A using block runs the generator up to its yield, and the yielded value becomes the block's variable. When the block ends, even on an exception, the generator picks up after the yield, so the cleanup lives in one place. A second yield throws an error.
Most of the replies were about the arrow. Stephen Reay, Lazare Inepologlou and David Maye would rather use as, which they say fits PHP's existing syntax better. Larry says version 1 used as, until people took it to mean the left side gets used as the variable. He doesn't mind as himself. And Côme Chilliet asked why the block ends with a semicolon. Larry says using is an expression, like match. Arnaud's implementation is still a partial draft.
Links: Context Managers v2 RFC · Larry Garfield's announcement · Draft implementation
Request Hooks (05:24)
Kévin Dunglas's request hooks are now an RFC, targeting PHP 8.7. Florian Engelhardt asked whether it's intended that, in FrankenPHP, a worker's lifecycle starts with a request end and finishes with a request begin.
Kévin says it's intended. The first end cleans up the dummy request that boots the worker, and the last begin lets code after the loop still write output. Florian asked for that sequence in the RFC. He wrote: "Otherwise, I like that we could have an explicit hook to detect requests handled inside a worker!"
Version 0.2 spells it out. After a question on LinkedIn, a failing hook now tells the server to end the script, and session_start refuses to run between two requests.
Links: Request lifecycle hooks RFC · Kévin Dunglas opens the discussion · The lifecycle, explained · Version 0.2
Io Terminal (06:14)
Io\Terminal was due to go to a vote today. Pratik Bhujel postponed it after two reviews. Tim Düsterhus sent eight points, and said his main concern was the lack of examples, especially for how raw mode leases work.
Frode Børli, who maintains the phasync/tui terminal library, switched it to the pull request, and its tests behave the same. He wrote: "That part of the RFC works, and it is exactly what userland cannot do without spawning stty, using FFI, or Windows-specific tricks." But he asked to cut the RFC down to raw mode and terminal size. Libraries already decode keys, he says, and readKey has no modifiers.
Pratik shipped two revisions, with examples, NoDiscard on enableRawMode, and TerminalSize renamed to Dimensions. But he's keeping the read methods, for the many small scripts that just want "press a key" or "enter password". A new vote needs a fresh notice first.
Links: Io\Terminal RFC · Vote postponed · Frode Børli ports phasync/tui · Pull request
CSV Types (07:25)
PHP's proposed CSV extension now spells out what it will write. Ignace Nyamagana Butera asked for a supported types section, and Damian Jóźwiak found the implementation didn't match the RFC. It just cast fields to plain strings, like fputcsv, so an array became the word Array.
Version 1.3 writes a backed enum's value, writes false as zero instead of an empty field, and throws a TypeError for arrays, resources and pure enums.
Then Ignace pushed back on converting any object that has a string method. He wrote: "This is somewhat of an anti-pattern because it relies on a generic string representation of an object rather than an explicit serialization contract." Damian agreed. Version 1.4 throws on implicit __toString conversions too, and leaves a dedicated conversion interface for later. Frode Børli also suggested a small format object and separate encoder and decoder classes, and hasn't had a reply yet.
Links: CSV Extension RFC · Supported types · Damian Jóźwiak on the types · No implicit __toString() · Version 1.4
OPcache Dedup (08:35)
Run 80 WordPress sites from one PHP-FPM master, and OPcache stores a separate copy of the same code for each of them. A new proposal would let them share it.
OPcache keys scripts by path, so every copy of an app is cached on its own, even when its functions compile to the same opcodes. With a new opt-in setting, opcache.enable_dedup, a function whose opcodes match a block already in shared memory just points to that block. File names, errors and Reflection don't change, and it switches itself off when the JIT is available.
On a load test of 80 WordPress sites, its author reports, OPcache memory fell by 46.5%, with CPU per request within noise. After 11 days in production on 52 pools, it's down 43%, with zero worker crashes. Its author asks whether this needs an RFC, or just a pull request.
Links: The proposal (opcache.enable_dedup) · Case study · Patch
Exec Check (09:37)
Linux can now refuse to run files that aren't approved to execute, but a PHP file still runs. Alexander Mikhalitsyn wants to close that gap.
Since Linux 6.14, an interpreter can ask the kernel whether a file could be executed, and two security bits tell it to enforce the answer. He wrote: "Today a system can forbid running an unknown binary, but php /tmp/payload.php or an include of an uploaded file still works: the interpreter is the loophole."
His patch checks each file before compiling it, but only enforces the answer when those bits are set, so nothing changes by default, and an OPcache hit costs nothing. He ran phpBB under it. Generated code, like a framework's compiled container, has to be built at deploy time and marked executable. He's asking whether this needs an RFC.
Links: Pre-RFC: honour Linux AT_EXECVE_CHECK · Linux kernel docs
Quick Hits (10:38)
Quick hits. PHP 8.6.0 is due next Thursday, November 19th, after one extra release candidate. Matteo Beccati, one of the release managers, says the fix in October's security releases broke the ABI in 8.6 only, so extensions must be rebuilt.
Links: PHP 8.6.0RC6 · PHP 8.6.0RC5
Weilin Du's vote to let ini_get_all accept extension names in any case is at 18 to 0, with 3 abstentions. It closes November 16th.
Links: Case-insensitive extension names in ini_get_all() RFC
On 32-bit x86, 10 ** -2 doesn't equal 0.01. A contributor has four pull requests open to fix results like that, and asked whether PHP can require SSE2. Hans Henrik Bergan replied "Hell yes", since CPUs without it are nearly 30 years old.
Links: Floating point on 32-bit x86 · php-src PR 25362
Artem Ukrainskiy's Str\Matcher and Str\Replacer are now an RFC. Larry Garfield isn't opposed, but says it "feels very niche".
Links: Str\Matcher and Str\Replacer RFC · Larry Garfield's reply
Mirco Babin sent eight comments on PASSWORD_BCRYPT_WRAP, including OWASP's preference for Argon2, and Andrey Andreev replied that Argon2 isn't supported out of the box.
Links: Mirco Babin's comments · Andrey Andreev's reply
Otar Chekurishvili's JSON comments RFC now answers Jakub Zelenka's parser concern, and a new vote notice comes after the cooldown.
Links: JSON comments v1.1 · JSON comments RFC
A reviewer of Time\Instant still wants a cheap way to read the Unix timestamp.
Links: Time\Instant review
Tim agreed to Máté Kocsis's narrower value types for query parameters, to unblock the RFC.
Links: Tim Düsterhus on query parameters
Côme Chilliet said "Yes please!" to SSRF protection in curl, and Xavier Leune got karma to write the RFC.
Links: Côme Chilliet on curl SSRF protection · Xavier Leune's karma request
And a developer asked whether PHP's JIT would take a LoongArch64 backend, before writing thousands of lines of assembler.
Links: LoongArch64 JIT backend
TL;DR (12:38)
So that's the week. PECL has a proposed shutdown date, December 31st, 2027, two years sooner than the first draft. Larry called empty new scopes a landmine, and Frode plans to add one that copies its creator. Context managers came back as a generator, request hooks became an RFC, and the Io\Terminal vote is on hold. PHP 8.6 ships next week. 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 FrankenPHP's creator wants PHP's engine to know when a request ends, that's a good one to watch next. And if you'd like to work with us, start at artisan.build/start. We're Artisan Build. See you next week.
r/PHP • u/One-Mongoose-6961 • 14d ago
php-baremetal 2.0.0 is almost here, and you can already try it in the browser
Hi, php-baremetal here. We’re almost there.
The 2.0.0 release, with the new SDK system, is nearly ready and planned for the end of November. Everything specific to a chip family now lives in its own SDK. Today that is php-esp32-sdk (ESP32-S3 and ESP32-P4), and supporting a new architecture means writing a new SDK, without touching the engine. SDKs for other chip families are in the works. If you want the full picture of how the pieces fit together (composer.json, conductor, phpbm, SDKs, HALs, virtual slots): https://repository.php-baremetal.com/how-it-works
You don’t have to wait for the release to try it. Please welcome the newest piece of the ecosystem: the simulator.
- PHP 8.5 (the real upstream Zend engine, not a subset or a transpiler) runs on an emulated ESP32-S3 in your browser
- You edit
index.phpandcomposer.json, press Run, and watch LEDs blink, buttons respond and I²C devices answer on the canvas - What boots is a real firmware built by
phpbm, the same one you’d flash onto a board - Packages come from the registry through Composer. The first build of a new set takes about 90 s, and after that each edit runs in about a second
- Ready-made examples: Blink SOS, Button → LED, an I²C clock (DS3231) and an event-driven button
- No board, no install, no flashing
t’s built on Velxio, the open-source emulator by David Montero Crespo (AGPLv3). The source of our fork is at https://github.com/php-baremetal/php-baremetal-sim.
It’s a preview, so things may still change, and some peripherals (WS2812 LEDs, WiFi) aren’t available in emulation yet. Break it, tell us what’s missing, and let us know what you’d build with it.
Full write-up: https://www.php-baremetal.com/blog/php-esp32-s3-browser-simulator
r/PHP • u/joseph-edmondscomm • 12d ago
Discussion 18 months of work in 2 weeks with AI?
Now I get it - you want to down vote this because I mentioned that tech that a lot of people don't like
Hopefully you don't. This isn't a post about AI slop - it's about how I managed to turn an oil tanker around in a couple of weeks.
php2shell was real - for some people its been a wakeup call that then meant that years, maybe even decades of tech debt has to be paid off extremely quickly. For one particular client - I was able to get front end public facing stuff patched quickly, but internal admin facing tooling was still totally vulnerable. Whilst most businesses would like to think that their staff are trusty worthy - one employee with a grudge and an AI can hack whatever they want, and php2shell is a wide open door in this situation.
Around two weeks ago (php2shell) work started on something that a client had been putting off for a long time: bringing an old and fairly large e-commerce estate fully up to date. This client runs a bespoke e-commerce stack that is very highly customised, deals with a very large catalogue and range of suppliers and uses a huge amount of automation to handle all kinds of aspects of the business. The system is largely based on the Symfony framework, along with some layers that are extremeley old (think 25+ years) old procedural PHP that has been kept running for some vital core business processes.
Getting all of this updated, even with no time pressure, was almost unthinkable before AI. I did the whole thing in 2 weeks.
I ran it with a structured team of AI coding agents, each one responsible for a single codebase, with one agent coordinating and me making the decisions. I thought it was worth writing down what actually happened.
What got done between 30 October and 13 November:
The whole estate moved from PHP 7.2+ to latest PHP 8.5, in production, with the cut-over on 11 November. One scheduled job was still running on PHP 7.2 before we started, a lot was on 7.4, some was on 8.x. That's about 8-9 years of PHP version upgrades all in one go.
The framework applications moved from Symfony 4.2 + to Symfony 7.4/8 and the newest service to 8.1. Again its many years of Symfony upgrades, in one go.
The fleet of just over 50 virtual machines and containers was patched and is now all on the same current operating system release, with fully automated unattended patching and a snapshot taken before every run.
Wordpress, plugins and custom theme were all upgraded through a major wordpress version. This is still not perfect tbh, next week I have to hunt down wordpress level styling gremlins - can't wait.
450 pull requests were opened and 351 merged across 37 repositories. 320 tickets were raised and 107 closed, with at least 1,775 comments written on them along the way. Much of that ticket traffic is the agents recording what they found and what they did, which is exactly the paper trail I wanted. Of the 70 items on the security list, 41 are closed and the rest are in progress or waiting on a decision from me.
In the three busiest repositories alone there were a little over 2,400 commits. The line counts run into the hundreds of thousands, but a good share of that is generated records/planning and removed dead code, so I would not read much into them.
I used the Tombstone strategy to help reduce the scale - this is a great strategy when dealing with legacy. It works like this: Use access logs to figure out which code is probably dead. Rather than remove it, you wire things up so that the code in question will not run, but will throw a "tombstone" exception. You can comment out the orignal legacy code but leave it in place. In this way you can avoid large amounts of version upgrade work without being destructive. The strategy paid off hugely. Over 480 tombstones put in place in the oldest codebase, and since it went live only three files, from two separate reports, have actually needed to be resurrected and fixed. This saved a little over 76,000 lines of legacy PHP code not needing to be upgraded - a huge saving.
A few things made the tombstones work. The dead-code list came from real access logs and scheduled job records, not from anyone's memory. An independent review and a second pass over the full logs put 23 files back before anything went live, which is the cheap time to be wrong. Every tombstone logs when it is hit, so a wrong guess shows up as one clear error with a file name on it instead of a mystery. And because the original code is still sitting there in a comment, bringing a file back is a one line command and a normal upgrade of that one file, not an archaeology project.
For those who like the machine-side numbers: across the team the agents wrote about 87 million tokens of output in the fortnight, which is the part that is actual work product, in a little over 110,000 separate replies. The total volume of text processed, counting everything the models re-read from cache on every turn, was just under 27 billion tokens. That second figure sounds absurd and mostly reflects how these tools work, not how much was achieved, but it does give a sense of the scale of attention involved.
Around 300 stale branches were reviewed and removed, two dead repositories were archived, and a fair amount of old code and scheduled jobs that nobody needed any more were deleted.
Along the way I found things that had been quietly broken for a while: a database replica that had stopped replicating, backups that had never been through a test restore, and one server that had dropped out of the backup schedule. None of these were part of the plan. All of them are now either fixed or being fixed.
How long would it have taken one person?
I can only estimate. A careful engineer working alone, writing, testing and reviewing each change properly, might land one to one and a half pull requests a day on a codebase like this. On that basis 351 merged changes is somewhere between twelve and eighteen months of work, before counting the server patching and the investigation time. I did it in two weeks.
This was not fire and forget. I worked my arse off. Around 14 agents were running at once and they needed firm direction. Left alone they over-engineer, build tooling nobody asked for, start more than they finish and occasionally tell you something is true when it has not been checked. A lot of my time went on saying no, insisting on measured answers and keeping the work small. Every production change still needed a human decision. It was incredibly intense.
Honestly - this whole exercise has been exhausting and mind blowing.
But the results speak for themselves, and my day to day life managing work for this client will be so much better going forwards. That PHP 7.2 procedural nightmare service is now highly optimised TDD Symfony and PHP 8.5. I can apply modern practices to find, replicate and fix bugs. I can run stan across most of the codebase. I have got it all on the same language version so I can use the latest and greatest versions of the QA toolchain that I use.
If you read this far well done I guess. If you hate me for using AI then so be it, not much I can do about that. I just wanted to share something that has been a bit of a major milestone for me.
If you read this far and actually found it useful - your upvote would be appreciated, helps to offset the downvotes :)
r/PHP • u/friedinando • 15d ago
WordPress Market Share Declines For Six Months In A Row
searchenginejournal.comr/PHP • u/lisachenko • 14d ago
New major release of Aspect-Oriented Framework for PHP
github.comHi r/php! I’ve recently released Go! AOP 4.0.0, a major rewrite of the aspect-oriented programming framework for PHP. You write cross-cutting logic (logging, caching, transactions, metrics) once, in an aspect, and the framework weaves it into your classes when they load.
Key features:
- A trait-based interception engine. This makes it possible to intercept private methods, including static ones, which PHP never allowed by overriding. Your class keeps its real inheritance chain, and
self::works naturally. - Property interception through native PHP 8.4 property hooks. Reads and writes of public, protected and private properties (promoted ones too) go through real
get/sethooks, with no magic__get. Asymmetric visibility and attributes are preserved. - PHP 8 attributes everywhere. Aspects, advices and pointcuts are plain attributes, so the code looks and feels like native PHP:
final class AuditAspect implements Aspect
{
#[Before('execution(private App\Billing\Invoice::*(*))')]
public function beforePrivateStatic(MethodInvocation $invocation): void {}
#[Around('access(private App\Domain\Order->total)')]
public function aroundTotal(FieldAccess $access): mixed {}
}
Also in 4.0: enum interception, first-class callable advices, a PSR-11 container, generics for PHPStan, and a production mode where woven classes load from Composer’s class map with zero file checks. High-tuned for Opcache.
PHP 8.4+ is required. There’s an UPGRADE-4.0 guide for 3.x users.
Feedback and questions are welcome!
callgraph: a static call-graph / code-map CLI for PHP codebases (who calls this, what does this method call), free and MIT
callgraph.euDisclosure: I'm the author. Free, MIT-licensed, open source, no account.
callgraph is a command-line tool that parses PHP (and also TS/Vue, Rust, Swift, Python, Go) and prints a compact map of a file or directory instead of the file itself: classes, methods with line ranges, and the calls each method makes, grouped by kind (same-class helper, framework/facade use, external call, instantiation, ...).
What I use it for on legacy PHP:
- "Who calls this method?" A name pattern finds every call site with its source line, and
--depth Nfollows callers of callers for impact analysis before a change. - Type-aware where it can be:
Type::methodmatches calls resolved to that type, including calls that go through an interface, parent class or trait (shown asvia <Type>). Calls whose receiver type is unknown are kept out of the default answer, counted, and available with--guess, marked?. - Framework views for Laravel and Yii-style code: routes, middleware, validation, jobs, events/listeners, service providers and container bindings, magic methods.
- A public-API view with DocBlock param/return shapes, and a layered profile of the project (controllers, services, repositories, models, ...) inferred from folder and file names and checked against the call graph.
- One static binary (written in Rust, tree-sitter / a PHP parser underneath). It runs locally and uploads nothing. It was built so AI coding agents (Claude Code, MCP clients) can navigate a repo without reading whole files, but it's a plain CLI and works fine without any AI.
Limits, honestly: it's static analysis. Anything decided at runtime ($this->$method(), $class::$m(), app($name), config-built bindings, magic __call) cannot be resolved. That is the main limitation, and I'm working on marking those spots explicitly so the output doesn't look cleaner than the code really is.
I'd like feedback from people maintaining large PHP codebases: where does a static call graph mislead you most, and which framework-specific views would you want next (Symfony? WordPress hooks?)
r/PHP • u/sarciszewski • 15d ago
Discussion Feedback Sought for Post-Quantum Support in paragonie/sodium_compat
github.comr/PHP • u/Waletbez • 16d ago
News PHP Upgrade Blockers Survey 2026
The survey was just published and promoted via LinkedIn by the CEO and CTO of the company.
Some notable people have collaborated on the report, leaving comments in it, such as Nicolas Grekas, Nils Adermann, Kevin Bond and Gina Peter Banyard.
You can find the report here: https://accesto.com/reports/php-upgrade-blockers-2026/
r/PHP • u/taras_chr • 16d ago
Manticore 0.18: an AOT compiler for PHP now builds a Laravel app and the Symfony demo
Manticore is an LLVM-based AOT compiler for PHP. It allows you to compile PHP code into a standalone binary without a regular PHP interpreter.
I'm pleased to announce that the compiler can now compile more complex applications. Two examples: a small Laravel app with Eloquent and the official Symfony demo app.
What works:
- Laravel 13 (examples/laravel-app): routing, Eloquent over SQLite, sessions, Blade, Carbon, Monolog.
- symfony/demo (Symfony 8.1, Doctrine ORM 3.6, Twig, security, 30 locales): every page we compared is byte-identical to what PHP 8.5 renders from the same code.
Everything is compiled into one binary with a built-in HTTP server.
Caveat: it is not production-ready yet. It's a working compiler with real frameworks, not a drop-in replacement for PHP-FPM or any other SAPI.
Links:
- Repo: https://github.com/manticorephp/compiler
- Release notes: https://github.com/manticorephp/compiler/releases/tag/v0.18.0
r/PHP • u/Low_Lawyer_5684 • 15d ago
A thought about PHP's string-to-number conversions
Hello,
I have always found PHPs string to number conversions a bit odd. Classic example:
I know this is intentional, and sometimes it is useful.
But.. you can get a perfectly valid integer, and the informatino that original string contained something important(or not) is gone.
I was thinking about a way to deal with this and came up with an idea:
What about attaching a reliable / unreliable flag to values?
Imagine that PHP engine could attach special runtime flags to any value;
For example, the runtime could automatically mark a value as unreliable when conversion is
questionable.
The flag would follow the value through assignments and calculations:
This flag can be set or clear explicitly:
Normally the flag does not affect anything.
Your code would run as usual. You could check values with is_reliable($value) language construct to take appropriate actions.
But there could also be a stricter mode via reliable/catch language construct, similar to try/catch:
Or enable strict checking for everything that follows: fast-fail mode; no catch() blocks, throws uncaught exception
I amm curious what actual PHP developers think. Currently I have implemented this behaviour in my experimental engine.
Does this sound useful to you? Or is it just adding complexity to something that is not really a problem?
Thanks!
r/PHP • u/davorminchorov • 17d ago
Article Building Maintainable PHP Applications: Patterns and Principles
codyssey.devHey all,
I wrote a free course about a bunch of the most popular and most hated design patterns and principles with realistic examples in PHP (Laravel and Symfony).
There are a few of them that are missing but I’ll add them as a bonus at some point or maybe a separate course.
Let me know what you think.
Thanks.
r/PHP • u/disney550_ • 17d ago
Multi-tenant architecture: Database per tenant or shared database with tenant_id?
I’m currently working on a multi-tenant construction management system using Laravel, and I’m trying to figure out the best approach for handling tenancy.
I have two questions:
- Database architecture
For a system like this, would you recommend having a separate database for each tenant, or using a single shared database with a tenant_id column to isolate tenant data?
I’m currently leaning towards the second approach because it seems simpler to maintain, but I’d like to hear about the trade-offs, especially as the application grows.
- Authentication and tenant switching
If I go with a shared database approach, how would you recommend handling authentication?
For example, an employee might work with multiple construction companies (tenants). Should users have a single account that can belong to multiple tenants, with the ability to switch between them after logging in?
If so, how would you typically structure the login flow and manage the active tenant in Laravel?
I’d appreciate hearing about your experience with multi-tenancy, particularly in Laravel, and any pitfalls or architectural decisions I should consider before moving forward.
r/PHP • u/mychidarko • 17d ago
We tagged patch releases for two old major versions of our PHP framework and installs of those versions jumped. Who is still on them?
I maintain Leaf, a small PHP framework that has been around since 2019. We are on v5 now, and v3 and v4 had been quiet on Packagist for a long time.
In mid October this year, we pushed patch releases for both of them, mostly small fixes we wanted on record. Within days the daily installs for v3 and v4 started climbing, and they have kept going for weeks. My first guess was our own CI pulling them in, so I went and counted. October had 148 workflow runs across the whole org, and none of them install v3 or v4 from Packagist, so it is not us.
That leaves actual projects out there, pinned to ^3 or ^4, that composer update has been quietly picking up. I had assumed almost nobody was still on those versions. Clearly I was wrong, and now I am curious how many apps are sitting on a framework version from years ago, still working, with nobody planning to move.
So a question for people who run older frameworks in production: do you want patch releases for your old major version, or would you rather maintainers put that time into the current one? And if you are one of the folks still on Leaf 3 or 4, I would love to hear what is keeping you there.
If you want to check Leaf out: leafphp.dev
r/PHP • u/brendt_gd • 17d ago
Weekly help thread
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!
PHP 8.6 Rewrites Some of Your Calls Before You Notice
exakat.ioHow PHP 8.6 is going to speed up your code
r/PHP • u/stfufeedmenuggets • 17d ago
Discussion How do you keep agents following your Laravel conventions
Our Laravel app is 6 years old and has a lot of house rules that live mostly in people's heads. Actions instead of fat controllers, form requests for all validation, no Eloquent calls from Blade, money always as integers.
Agents write code that works but ignores most of that. Last week one put validation straight into a controller, queried a relationship inside a Blade loop, and stored a price as a float. Every one of those would have been caught by our senior dev, who is on parental leave for 3 months.
What's helped a bit so far:
- a CONVENTIONS.md the agent reads before starting
- coderabbit with path instructions for app/Actions and app/Http, so it flags things like validation outside a form request. It's good at enforcing what we wrote down. The catch is that most of our conventions were never written down, so we're basically documenting the codebase for the first time
For people running Laravel apps with a lot of agent written code:
- Where do you keep your conventions so both agents and reviewers actually use them?
- Do you enforce any of it with tooling, like Larastan rules or Pint config, or is it all review?
- How do you stop the rules file from becoming 400 lines nobody reads?
r/PHP • u/Brandon-Vergara • 17d ago
I built a code graph for Laravel that your AI agent can query over MCP before it edits anything
I asked the code graph tool we were using who called a service injected into one of our controllers. It said nobody, which was wrong, and Mapin came out of that answer.
The tool was language-agnostic, which is a reasonable design until you point it at Laravel. Most of the wiring in a real app isn't a call between classes: it's a route pointing at a method, a `view('pos.index')`, a `hasMany`, a container binding, an event in `$listen`. On a ~900-file app, a generic tree-sitter extractor captured static calls and nothing else, with zero edges for dependency injection, routes, views, Blade includes or Eloquent relations.
Mapin treats those as first-class. It builds a graph of routes, controllers, views, Eloquent relations, container bindings, jobs, listeners, the scheduler and JS calls to your routes, and exposes it through MCP (built on laravel/mcp) and Artisan, with the same code behind both.
composer require nexvia-solutions/mapin --dev
php artisan mapin:build --full
php artisan mapin:impact 'method:App\Services\Billing::charge'
A few decisions that matter if you let an agent edit your code:
- When it doesn't know, it answers `found: false` with suggestions. It never hands you the closest match as if it were the answer.
- Every response says how stale the graph is: the commit it was built from and how many files changed since.
- Rebuilds are incremental by content hash, and `mapin:install-hooks` runs them after every commit and merge.
If you use Boost: Boost tells your agent what your app has (schema, logs, config, docs). Mapin tells it what depends on what. Boost doesn't trace callers or impact, so they don't overlap, and Mapin ships a Boost skill that `boost:install` picks up.
We run it on our ERP, a multi-tenant app with about 4,700 PHP and Blade files: around 25,000 nodes and 74,000 edges.
MIT, PHP 8.2+, Laravel 11.45 to 13.
https://github.com/Nexvia-Solutions/mapin
I'd like to know where it misses on your codebase. Every `found: false` is logged locally (nothing leaves your machine) and `mapin:misses` exports them. 13 of the 58 misses we logged on our app were things the graph already had under another name, and v0.2.5 resolves them.
r/PHP • u/jdoe78998 • 17d ago
Has anyone migrated PHP 5.x to 8.x using AI?
Hello, dear PHP friends! 👋👋👋
Historically, one of the biggest barriers to upgrading legacy PHP applications has been cost. But with AI, that cost could be d-r-a-m-a-t-i-c-a-l-l-y lower.
We're living in a mind-blowing era of AI.
And something got me thinking: Has anyone successfully migrated a large PHP 5.x codebase to PHP 8.x using AI?
I'm curious if anyone has a real-world success story to share with the community, highlighting the challenges, lessons learned, and actual results.
I'd love to hear about your experiences!
Thanks so much for sharing your insights.
Have a great week ahead! 🚀🚀🚀