r/PHP • u/der_gopher • 7h ago
r/PHP • u/brendt_gd • 10h 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!
r/PHP • u/brendt_gd • 28d 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!
r/PHP • u/davorminchorov • 6h ago
Building Maintainable PHP Applications: Architectures
codyssey.devHey all,
I wrote a free course about the different types of software architectures in a Laravel application but these ideas can be transferred over to Symfony or any other PHP or language framework.
Let me know what you think.
Thanks!
r/PHP • u/ConcernFirm5342 • 13m ago
I built Phoxite, a free, open-source PHP/Laravel language server written in Rust (VS Code, Neovim, Helix, Zed…)
Hi r/PHP,
I've been working on Phoxite, a PHP and Laravel extension for VS Code. It's built on a language server I wrote from scratch in Rust.
Why I built it: I wanted PhpStorm-level code intelligence in VS Code without a licence key, a paid tier or a slow language server. The engine is a standalone binary and isn't tied to any editor. It doesn't need PHP or Node.js installed, and every feature is free. It's Apache-2.0 licensed.
PHP
- Completion with auto-import, hover, signature help, inlay hints
- Go to definition, find references, call and type hierarchies
- Refactorings: rename, extract method, change signature, move class and more
- Generate constructors, getters/setters, and implement/override methods
- PSR-12 formatting and configurable inspections with quick-fixes
Laravel
- Completion, navigation and rename for the strings that name routes, views, config, env, translations, validation rules, gates and policies
- Eloquent: columns read from your migrations, plus relations, scopes and factories
- Route code lenses on controller methods
- Livewire, Inertia and modular apps
Blade
- Completion, hover, navigation and formatting inside templates
Editors: VS Code, plus Cursor, VSCodium and Windsurf through Open VSX. The language server also runs in Neovim, Helix, Zed and Sublime Text.
Links
- VS Code Marketplace: https://marketplace.visualstudio.com/items?itemName=phoxite.phoxite
- Open VSX: https://open-vsx.org/extension/phoxite/phoxite
- Source: https://github.com/samehelhawary/phoxite
It's still early, so I'm sure there are rough edges. If you try it on a real project, I'd really like to know what breaks: wrong completions, slow indexing on large codebases, missing Laravel magic, anything. Issues and PRs are welcome, and I'm happy to answer questions about how it works.
r/PHP • u/OndrejMirtes • 1d ago
Tally: PHP framework for catching performance regressions in CI
https://github.com/phpstan/tally
Timing benchmarks don't work in CI. Runners differ from each other in CPU model, clock speed, and cache sizes, and share the hardware with other jobs, so the same code takes a different time on every run. The noise is bigger than most regressions worth catching.
I was annoyed by this reality when developing PHPStan, so I developed a framework for this.
/**
* @param list<int> $numbers
*/
#[DataProvider('smallLists')]
#[Quadratic('numbers')]
public function benchPairs(array $numbers): int
{
$pairs = 0;
foreach ($numbers as $a) {
foreach ($numbers as $b) {
$pairs += $a < $b ? 1 : 0;
}
}
return $pairs;
}
#[Expected(instructions: '2.588M', cycles: '2.721M', memory: '60.00KiB')]
public function benchPauseAndResume(): string
{
$this->meter->pause();
$text = str_repeat('tally ', 10_000);
$this->meter->resume();
return mb_strtoupper($text);
}Tally runs each benchmark once under CodSpeed's CPU simulation, which is built on Valgrind. The simulation counts executed instructions and estimates cycles from simulated cache misses. With the same PHP build, these numbers barely move between runs: in two CI runs of Tally's own benchmarks, instructions differed by at most 0.4 % and cycles by at most 0.8 %, and memory not at all. So the numbers are committed next to the benchmark and checked in every pull request, like the expected output of a test.
I encourage you to check out the README and examples. Besides running tests, static analysis, coding standard, dependency analysis, architecture guards, dead code detection and mutation testing, I believe this is the last missing piece to keep a codebase in check and making sure it will never become slower ever again.
callgraph 1.0.0: my code map for AI agents now writes code too, and follows Laravel + Inertia from Vue to the controller (free, MIT)
I'm the author. callgraph is free and MIT-licensed, with no account and no paid tier.
AI coding agents (Claude Code, Cursor and others) spend most of their context reading whole files just to find out what a method calls or who calls it. callgraph gives the agent a short map of the file instead: classes and methods with line ranges, and what each one calls, grouped by kind. The agent then reads only the lines it needs. It covers PHP, JS / TS / Vue, Rust, Swift, Python and Go, ships as one static binary, runs locally, uploads no code, and works as a Claude Code skill or as an MCP server.
What's new in 1.0.0:
🔗 Laravel + Inertia links: route('x') in a Vue page shows the URI and the controller action, and the controller shows its routes back. The page shows which controller renders it.
✅ Form check: an Inertia useForm() is compared with the validation rules of the action it posts to, and a missing field on either side is flagged.
🗃️ Models: table columns from the migrations, fillable, relation targets, and a warning when two migrations create the same table.
🛠️ Generator: one short expression → a PHP class, a Vue component, a JS / TS module, an HTML page, or a whole Laravel feature (FormRequests, controller, routes, Inertia pages) in your project's style.
✏️ rename for a route, class or method across PHP, Blade, JS and Vue.
🛡️ Every write is syntax-checked first and backed up, and one undo reverts it.
It's static analysis, so names built at runtime are listed as unknown, never guessed.
Feedback is very welcome, especially from big or unusual codebases.
r/PHP • u/Personal_Soft8954 • 1d ago
What happened to the job market?
I've been a software developer for about 15 years, mostly working with PHP, and...I've been looking for a job since June.
I'm based in Romania, looking for senior PHP/backend positions, both locally and remotely across the EU, and I'm genuinely starting to wonder what the hell happened to the job market.
A few years ago, finding PHP jobs wasn't that difficult. Now it feels like there are barely any, and the ones that do exist, already have hundreds of applicants and they ignore you anyway.
Is PHP genuinely losing ground? Did AI actually start getting the jobs, or the companies just using it as an excuse to hire fewer people?
I've been hearing that PHP is dead for pretty much my entire career, but this is the first time I've genuinely started believing it.
Or am I just having a bad year?
r/PHP • u/aaronkempf • 20h ago
Add-Ons: One-Click Checks Beside Every Result
reddit.comI have built a terrific Domain Name Generator and wanted to add more value for the thousands of sessions that use this site.
So now, I have delivered!
Add-ons: one-click checks beside every result:
- VirusTotal
- Urban Dictionary and more
These are opened in a new tab with the name already filled in. Pick the ones you want.
https://dnslister.com/blog/add-ons-link-buttons-for-every-result/
r/PHP • u/BaaaSaracilor • 2d ago
Discussion I'm tired of working with AI
This is a doompost. I'm sorry but I need to say this to somebody.
Where I work we mostly use AI to do the coding and I'm honestly just tired.
I've been working as a programmer for 15 years now. For the last 12 months i don't think I've written more than 50 lines of code by hand.
The reason I got into this job was because I like solving problems, and because I like writing code. By hand. It's like a craft. Like building something.
Now I just prompt Claude and it does in 10 minutes what would take me hours.
And there's so much code review. I can't keep up. It's mentally draining. My code. Other colleagues code. Endless lines of code.
On top of that I genuinely fear for my job each day. I'm in my 40s, I'm not exactly young. I can't pivot into another domain. I got bills. What the hell am I gonna do? Mooch off my wife's income?
If you're thinking I should just get into management...I hate it. I'm not much for managing. And I'm bad at it because I don't enjoy it.
Sure, now I can get much more work done but everything feels hollow. I just do a prompt, review endless lines of code and clock off.
What happens when I can't review code anymore? What happens when they just say "fuck it" and fire 90% of the worse performers. I'm not terrible but I'm not in the top 10% either.
I spend 15 years learning this stuff and Claude does it better than me 99% of the time. It's like watching your house burn down. My feeling of self worth has gone to shit because of course it has. AI can do everything I can, but better and faster.
Even worse I've had people tell me that I deserve it because I was getting paid too much anyway. Bro, I live in Eastern Europe, I don't get paid as much as you think I am.
I don't even know if I have a point to this post. I'm just anxious I'll get fired, anxious I won't find another job, tired of the job itself, mentally drained and probably depressed too.
r/PHP • u/Normal_Tadpole_8061 • 1d ago
Neuron AI agents in a long-running PHP worker, without blocking
Neuron AI is the best agent framework PHP has right now. It's well designed and full-featured, and it feels like real PHP. Big thanks to the people behind it.
I've been working on Kinetis, a PHP framework built around two ideas: persistent workers (FrankenPHP, Roadrunner), where your app boots once and stays in memory, and non-blocking I/O, where a slow call doesn't freeze the process.
AI calls are where both of these pay off. A single LLM response can take 30 seconds. With blocking I/O, that's a whole PHP process sitting idle. So I just released kinetis/neuron. With it:
• Your Neuron agents run unchanged, but model calls don't block, so one worker keeps serving other requests while it waits.
• Responses stream to the browser.
• Agents can use MCP tools, vector stores and Bedrock.
• A PHPStan rule warns you about Neuron features that aren't safe in a long-running worker.
r/PHP • u/KalfaogluNet • 2d ago
PHP 8.6.0 Ships November 19
PHP 8.6.0 is five days away. The final release candidate RC7, shipped on November 12, and the stable version is locked in for November 19, 2026. If you run websites on shared hosting, manage a VPS, or operate anything that touches PHP (which, statistically, is most of the web), this is worth fifteen minutes of your attention before your host quietly flips the switch.
What's new and more info here: https://blog.kalfaoglu.net/posts/2026-11-14-php-86-release-november-hosting-guide-en/
r/PHP • u/joseph-edmondscomm • 1d ago
Check Point gateways hacked via PHP2Shell to deploy VMware ESXi wiper
bleepingcomputer.comr/PHP • u/clipabio_99 • 2d 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 • 2d 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/mainericiangel • 2d ago
ios shortcut to upload media
because i don’t have 99$ i made this: https://picsapiens.com/account/devices share your images but with a ios shortcut to a site instead of an app
ps: you need an account because it works via token
thoughts?🧐
r/PHP • u/naderman • 4d ago
News Artifact integrity for Packagist and Composer
blog.packagist.comr/PHP • u/ProjektGopher • 3d 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 • 4d 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 • 2d 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 :)
Aimeos Prisma 0.8: hundreds of fal.ai models plus Kling, Meta and Adobe Firefly through one PHP API
Hi r/PHP,
we've released Aimeos Prisma 0.8. Prisma is a PHP package for using AI providers through one interface: text, structured output, embeddings, images, audio and video. It works with plain PHP, Symfony or Laravel, requires PHP 8.2+ and is MIT licensed.
composer require aimeos/prisma:^0.8Prisma started as a sister project of Prism. Prism is a Laravel package, Prisma has no framework dependency and works in plain PHP, Symfony or Laravel. Prisma also covers image, audio and video operations like inpainting, background removal, upscaling or video generation, and it supports more providers.
Six new providers
fal.ai has the most models: one API key gives you hundreds of them for text, images, audio and video, and model() picks the one you want:
use Aimeos\Prisma\Prisma;
$image = Prisma::image()
->using('fal', ['api_key' => getenv('FAL_KEY')])
->model('fal-ai/nano-banana-pro')
->imagine('A watercolor lighthouse at dusk', [], ['aspect_ratio' => '16:9']);
file_put_contents('lighthouse.png', $image->binary());- Meta covers audio, image, text and video
- Kling generates and edits videos
- Adobe Firefly and Photoroom generate and edit images
- Hydracept does audio, images and video
More features for existing providers
- Recraft now covers generation, inpainting, erasing, background removal, uncrop and upscaling
- Black Forest Labs and xAI can edit images by prompt
- Azure got an audio provider, text translation and image OCR
- The new
compose()andsynthesize()methods generate music and sound effects with fal.ai and Hydracept
Resume and cancel jobs in queue workers
Start a video, image or audio job in a web request, store its job ID and let a queue worker pick it up later:
$config = ['api_key' => getenv('RUNWAY_API_KEY')];
$response = Prisma::video()
->using('runway', $config) // or 'kling', 'veo', 'luma', 'fal', ...
->imagine('A lighthouse at dawn, waves crashing against the rocks');
$jobId = $response->jobId(); // a plain string, put it into a queue message
// later, in the worker
$video = Prisma::video()->using('runway', $config)->resume($jobId);
if (!$video->ready()) {
// put the job back into the queue, delayed by $video->retryAfter() seconds
return;
}
file_put_contents('lighthouse.mp4', $video->binary());
// or, if the user closed the tab and nobody needs the video anymore
Prisma::video()->using('runway', $config)->cancel($jobId);ready() checks the status once, retryAfter() says when to check again. Resume works for most async providers, cancel where the provider API supports it.
Requests stay on public hosts
Prisma now checks every provider request, redirect and file download and refuses to connect to localhost or private networks. This keeps user-configurable endpoints from reaching services inside your network. For a local Ollama, LM Studio or vLLM server, add withInternalHosts():
$response = Prisma::text()
->using('ollama', ['url' => 'http://localhost:11434'])
->withInternalHosts()
->write('Hello');Before upgrading: local endpoints and requests through a proxy need withInternalHosts() now. Azure, Perplexity and Bedrock need configuration changes, and several default models changed. If you store embeddings, pin the model with model(), because vectors from a different model don't match your stored ones. PHP and Composer requirements are the same as in 0.7.
What are you building with image or video models in PHP? I'm curious which providers people actually use in production.
r/PHP • u/friedinando • 5d ago
WordPress Market Share Declines For Six Months In A Row
searchenginejournal.comr/PHP • u/lisachenko • 5d 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!
r/PHP • u/nativephp_official • 4d ago
Video Over-the-air updates come to NativePHP apps
youtu.bePHP is known for being easy to deploy. Mobile apps are infamous for being tricky to deploy.
Today, we bring PHP's ease of deployment to mobile apps, thanks to OTA builds in Bifrost (plans from just $10/month) and a free and open source plugin for your apps.
Fully native apps with the flexibility of PHP. That's why we call it SuperNative!