r/PHP • u/Emotional-Ask-9788 • 7h ago
r/PHP • u/Normal_Tadpole_8061 • 9h ago
Laravel’s Move to Rust and Go Exposes the Collateral Damage It Left Behind in PHP
Laravel releasing official frameworks for Rust and Go isn’t just an expansion play. It is the clearest signal yet that the architectural habits Laravel spent over a decade normalizing in PHP are hitting a wall in the age of AI-assisted development.
For years, Laravel was celebrated as PHP’s savior. It made building web apps fast, expressive, and approachable. But that convenience came with quiet collateral damage to the broader PHP ecosystem:
- It normalized "magic" over explicit architecture. Static facades, global helpers, container auto-resolution, and magic model properties trained thousands of developers to optimize for keystrokes instead of clear boundaries, dependency graphs, and predictable types.
- It blurred the line between "Laravel developer" and "PHP engineer." While modern PHP steadily evolved toward strict types, static analysis, and clean OOP (pushed forward by tools like PHPStan, Psalm, and Symfony), much of the ecosystem remained anchored to active-record coupling and framework-first patterns that resist static reasoning.
- It created codebases that punish static tools and now AI agents. What feels ergonomic to a human writing a tutorial becomes opaque to static analyzers and autonomous coding agents. When behavior lives in runtime resolution and implicit conventions, machines have to guess what a compiler would otherwise verify.
Now, look at what Laravel itself highlights in its Rust and Go releases: compile-time schema and validation checks, explicit structs, no silent lazy-loading, and type-safe boundaries. In other words, the very guardrails Laravel downplayed in PHP are now front-and-center selling points when targeting compiled languages.
Laravel didn’t cause 20 years of PHP’s rough history. However, by making runtime magic the gold standard for a generation of PHP apps, it left the ecosystem with millions of lines of code poorly suited for an era where static guarantees matter more than ever.
Disclosure: I am the developer behind the Kinetis Framework.
r/PHP • u/mychidarko • 11h ago
What we've shipped in Leaf since 5.0: FrankenPHP worker mode, PHP 8.6, agent-friendly defaults
Hi folks!!! Leaf maintainer here. Some of you might remember Leaf 5 which we shipped in August, our take on modularised and lightweight PHP without sacrificing all the goodies you get in other batteries-included frameworks.
There's a full post on all the stuff we've done since then at blog.leafphp.dev/posts/fastest-way-to-build, but I wanted to share a brief here.
- We introduced a new version of our Eien server which is now based on Franken PHP
- Better PHP 8.6 support
- Clearer instructions for agents on how to write better code
- Some upcoming products to help folks build faster
Leaf is at about 822,000 installs across the whole ecosystem, free and open source, run by a very small team. We'd love you to give it a try, whether you're writing code yourself or using an agent. Happy to answer anything, and if you try Eien and the numbers do not hold up on your setup, I would genuinely like to hear it.
r/PHP • u/ahmadalmayahi • 11h ago
Laravel Rust is 18x faster at solving a problem you don't have
reddit.comWeb UI for the Laravel and Symfony scheduler, every run with its output and exit code
youtube.comthe usual setup is one * * * * * php artisan schedule:run line in crontab. works fine, until you want to know what a task did last night. output goes to /dev/null by default, and if it threw, the stack trace is somewhere in laravel.log between everything else.
so i made runwisp/runwisp. it runs the schedule you already have and keeps every run in a web UI: what it printed, the exit code, how long it took, and the exception if it threw.
composer require runwisp/runwisp
php artisan runwisp:workthat replaces the cron line. routes/console.php stays as it is.
on Symfony it's bin/console runwisp:work, your #[AsCronTask] and #[AsPeriodicTask] work as they are and messenger:consume scheduler_default can go.
few things r/PHP might care about:
- every run is its own
php artisan runwisp:run <task>process. a command that leaks memory can't take the next run down with it, and Stop in the UI kills the actual process. - when
when(),between(), maintenance mode orwithoutOverlapping()skips a run, it shows up as skipped with the reason, likethe when() at routes/console.php:10 returned false. a streak of skips folds into one row so it doesn't flood the history. - your queue worker can run under it too and gets restarted when it exits. so Supervisor can go as well.
runwisp:checklists every task with its next run and validates the config. it exits with 1 on a mistake, so you can put it in CI. after a deployrunwisp:reloadpicks up the new schedule and running tasks keep going.- each run happens once per data directory, however many workers you start. you don't need
onOneServer(). #[RunWisp\Task(retry_attempts: 3, timeout: '10m')]on a command or job adds retries, timeouts and Slack/Telegram alerts. the options are PHPStan array shapes generated from the config's JSON schema, so a typo fails phpstan (andrunwisp:checktoo).
under the hood it's one Go binary with the scheduler, process supervisor, SQLite and the UI embedded. the composer plugin downloads it for you. no Redis, no extra DB, no Node. CodeIgniter 4 and plain PHP scripts work too.
Laravel 11 to 13, Symfony 6.4+, PHP 8.2+.
https://github.com/runwisp/runwisp
https://docs.runwisp.com/sdk/php/laravel/
https://docs.runwisp.com/sdk/php/symfony/
what does your schedule run on right now? curious what i'm actually replacing :)
r/PHP • u/hatamabolghasemi • 20h ago
i built a php extension for prometheus metrics
hey guys, i have built an extension that exposes some main metrics about your app's functions and entrypoints and right now i need your test and feedback so we can make it more mature together.
https://github.com/hatam-abolghasemi/php-prometheus-extension
briefly if i have to explain what my mindset and intention was for creating it, it's like there is no php-exporter anywhere and traces and APMs are expensive to have and so what if we can make something in between? it's not basically an exporter, it's not a profiler neither. it's just a wrapper around functions and it's tried to be built as lightweight as possible. that's it. test and give me feedback please.
thanks in advance
r/PHP • u/Chemical_Plum_collab • 1d ago
How I set up and run a local PHP MVC workflow from scratch using Pocket Editor and FusionPHP (full text walkthrough)
facebook.comFull disclosure: I am the developer behind both Pocket Editor (a lightweight Python desktop code editor) and FusionPHP (a small PHP MVC framework). I wanted to share the exact workflow I use to spin up a new project, get live template syntax checking, and test changes locally without opening a heavy IDE.
### Prerequisites
* PHP (with the built-in CLI server)
* Git
* Pocket Editor (`pipx install pocket-editor` or from source at https://github.com/somidouth-collab/pocket-editor)
### 1. Select a Workspace Directory
Open Pocket Editor, go to the **Project Explorer** on the left sidebar, click the folder icon, and select your parent workspace folder (for example, `Projects/tuto`).
### 2. Clone the Starter Project via Built-In Git
Instead of dropping to a separate terminal to clone the repo:
- Switch to the **Git** tab on the left panel.
- Paste the repository's HTTPS URL into the **Remote URL** field and click **Clone**.
- Confirm the parent directory and name the new folder `lesson_one`.
Once cloned, the directory layout populates in the explorer:
```text
lesson_one/
├── app/
│ └── views/
│ └── home.tpl
├── fusionphp/
├── plugins/
├── public/
└── tests/
Discussion Follow-up to the PHP2Shell version count from October: two weeks after the fix, 96% of sites on managed hosts showed a fixed version, 23% on cloud servers
I work at IPinfo. In October I posted the version count from before the PHP2Shell fix. After that we rescanned the same addresses every day for two weeks after the October 21 release.
- 87,865 live sites on 8.2–8.5 that didn't show a fixed version on October 22
- Five networks run by hosting companies that update PHP for their customers: 95.6% fixed after two days, 96.4% after two weeks
- Cloud servers at four big providers, where the owner runs updates: 12.5% after two days, 22.7% after two weeks. Each provider ended between 21% and 24%
- Across the 395 networks with at least 20 of these sites, the median was 32%
- On 5.4–8.1 (source patch only, or no fix): 2.8% of 265,141 sites moved to a fixed version
What we can't see: distro backports that keep the version number. We left out versions with a distribution tag; only 2% of the cloud sites ran a stock Ubuntu version. Red Hat-family Linux and Amazon Linux shipped new version numbers, so they're counted. Every share is a minimum.
Two-thirds of the cloud sites that didn't move were already four or more releases behind on October 22.
If you run PHP on your own server: what stops you from updating the day a fix comes out?
Full write-up with the method: https://ipinfo.io/blog/security-patch-adoption-managed-hosting-cloud
News PagibleAI CMS 0.14: multilingual pages, 5 CMS importers, 17 new themes
I maintain PagibleAI CMS, and 0.14 is out. It's a full-featured, MIT-licensed CMS that you add to any existing Laravel 11–13 app (PHP 8.2+) with:
composer req aimeos/pagibleYou get a page tree, structured content elements, drafts with full history and a Vue admin for editors. Your frontend reads content through JSON:API, the Blade themes or Eloquent models. It's a finished CMS rather than an admin toolkit, and everything lives in your database next to your own models.
The AI parts (writing, translation, images, an MCP server for agents) are optional and stay off until you add API keys - or can be skipped totally in custom distributions.
Languages
Most of the work in this release went into languages. In 0.13 and earlier, a translation was a separate page linked to the original. Now a page is a single tree node with one variant per language. Each variant has its own URL, drafts and publish date, and when you move a page, all its languages move with it.
Reading a page in a regional language falls back along a chain:
use Aimeos\Cms\Models\PageView;
$page = PageView::live($request->user(), 'de-CH')
->where('path', 'what-is-pagibleai')
->firstOrFail();
$page->lang; // "de" if there's no Swiss German variant, else the source languagede-CH falls back to de by default, and you can define your own chains in the config, e.g. 'lb' => ['de', 'fr']. The fallback is resolved in SQL: a derived table left-joins one variant row per language in the chain and picks the first match, so nothing gets loaded and filtered in PHP. Pages also send hreflang links and a Content-Language header.
Editors see which translations are outdated after the source page changes. Translate sends only the changed elements to DeepL or an LLM and saves the result as a draft. cms:user --langs=fr limits a translator to the French variants.
Importers
There are new importers for Drupal 7/8+, Joomla 3–5 and Statamic, with the WordPress and TYPO3 importers were mostly rewritten. They read the old database through a regular Laravel connection and bring over the page tree, redirects and SEO metadata. Translations end up as variants of their original page, not as separate pages. WordPress has no built-in translations, so that doesn't apply there.
php artisan cms:joomla-import --connection=joomla --dry-runAll importers accept --since=2026-11-01 to import only content changed since that date. That lets you keep the old site running while you build the new one and sync the changes before switching over. They're still beta, and every old CMS database has its own quirks. If one fails on your data, an issue with the error message helps me most.
Themes
There are 28 themes now, most of them for specific businesses like plumbers, electricians, builders, doctors, law firms, restaurants and salons, plus SaaS, documentation and portfolio sites. All of them come with demo content. Each theme is its own Composer package based on Pico CSS variables and shared Blade components, so restyling one mostly means changing tokens.
Available themes: https://pagible.com/themes
Upgrade
This is a breaking upgrade. The migration turns every existing page into the source variant of itself. Translations that were linked as separate pages in 0.13 stay separate, and you have to merge them yourself. The PHP API, GraphQL, MCP and JSON:API changed too, and everything is listed in the upgrade guide.
- Upgrade: https://pagible.com/upgrade-pagibleai-cms
- Multilingual docs: https://pagible.com/multilingual-websites
- Repo: https://github.com/aimeos/pagible
If you like PagibleAI, give it a star on Github :-)
r/PHP • u/NeedforReads • 1d ago
How to get alerted when your Laravel scheduled tasks don't run
watchgoose.comHi all,
Sharing this here because I think others might find it useful too. I've seen clients run into the following. Say your Laravel app sends invoices every night at 2:00, if that task doesn't run, Laravel then won't tell you. Since nothing runs, nothing seems to have failed. You then only find out when a customer asks where their invoice is.
I made my own fix for this by letting something outside your server notice (basically a heartbeat monitor). It works by, when affter the task succeeds, it pings a URL. If it doesn't come, you get an email or a Slack message, so you can fix it before your customers notice.
My heartbeat monitor is called Watchgoose, and it's free to use for up to 10 checks. I also made a Laravel guide, which you can find in the link i shared!!
r/PHP • u/davorminchorov • 1d ago
Article Laravel Best Practices: Clean Code and Architecture
codyssey.devHey all,
I wrote a course about the bad habits that make Laravel codebases hard to change, work with as well as slower as the complexity grows over time in long-term applications.
The examples are specific to Laravel but they can also be applied to any other PHP application as well with the framework-equivalent approach.
I’ve made some of these mistakes myself as well as I’ve seen them in different projects of different sizes I worked on over the years so the list does come from experience.
The story and the examples are fictional but the habits are based on a true story.
Let me know what you think and if you find anything out of the ordinary in the text, readability or examples.
Thanks!
The 100 PHP functions in 2026
exakat.ioThe most commonly used PHP native functions, from the 2026 dataset.
Can you guess which is the most used function?
r/PHP • u/pittendrigh • 2d ago
I am new here
I'm 78.
Retired 16 years ago.
I have spent the last week rewriting an old php7.4 app so it runs under (is written with) php8.4......my protect is an ancient files based cms called Robopages.
< 10,000 lines of code but it does a lot.
Once I get that ironed out l will work on an update to a php 8.6 server. The upgrade to 8.4 was mostly about better coding practices (initialize everything and always check for NULL).
XML handling did change , from way back when.
Does the upgrade from 8.4 to 8.6 require coding changes? (I do a lot with SimpleXmlElements) ...which did change considerably from 7.4
Or does 8.6 exist mostly as a way of introducing hotrod new features?
r/PHP • u/Emotional-Ask-9788 • 2d ago
Discussion Laravel Go and Rust are not ready
reddit.comr/PHP • u/bearinthetown • 2d ago
Discussion Partial function application in PHP 8.6 is such a redundant feature (unpopular opinion)
PHP 8.6 adds a feature called partial function application. Here's how it works:
I'm not a fan of this feature, as it's just a confusing syntax sugar. Consider this example:
What looks like two instructions of the same kind, is actually two completely different things. They use the same structure, but the first one returns a function and the second one returns a value. This used to be considered an anti-pattern for a long time.
The older and more experienced I get, the more I feel like adding features to programming languages often does more harm than good. Languages get bloated and harder to read with not much in return. There are some changes I like (example: null-safe features), but there are also many I don't. Partial function application is one of them.
r/PHP • u/doomerbrown • 2d ago
Discussion Why php aint blowing up with AI ??
Excuse me if am uninformed but AI which led to a Rust boom ,Next.js becoming splattered across the internet
Why isn't PHP blowing up .Laravel is a great framework if you want to get things rolling so why is that i am not seeing it everywhere
Wordpress somehow still persist but not PHP frameworks .There are people using CI3 till now
So much php code out there . Is it the marketing??
r/PHP • u/Fedora-The-Pandora • 2d ago
Discussion Do I have code bias?
I know that code bias is a thing in programming, and I am always going to prefer my way of coding but I don't know whether the code I work with from our other developer is actually bad or whether I'm just being hit with code bias.
I have only ever worked with one other developers code, that hasn't already been obfuscated. Because of this, I have no baseline to know what the average code looks like.
Does anyone have any public projects I'm able to explore so I can find out if I do actually have code bias in these situations or whether there is something overly complex about the code the other developer is writing.
FYI. For some context I've learned that the other developer was originally a designer but has learnt to code. I do believe this may be a reason that we both work problems differently.
r/PHP • u/Bitter-Design-2491 • 2d ago
Discussion Measured Laravel Go (beta) vs Laravel PHP on FrankenPHP on one small endpoint: about 11x, worker mode did not close the gap
After the Laravel Go beta announcement I wanted to see how big the gap is on a small box, and whether FrankenPHP worker mode closes it. This is my own limited measurement, not an official benchmark.
Setup: same machine for both, 1 CPU, about 2 GB RAM, both apps on 127.0.0.1, freshly scaffolded defaults, no caching, nothing tuned. Endpoint: GET /api/posts, one ORM query on a one-row SQLite table, JSON response. Laravel Go is the beta binary. Laravel PHP is Laravel 12 on FrankenPHP 1.14 (classic request-per-request, OPcache on).
Load tool: a small custom Python script (urllib + ThreadPoolExecutor), 10 warmup requests, 200 sequential requests, then 200 requests at concurrency 20. No wrk, ab or k6.
Results:
- Laravel Go: sequential mean 0.47 ms (p50 0.45, p95 0.51), 2052.5 req/s at concurrency 20, RSS 32.4 MB
- Laravel PHP classic: mean 5.14 ms (p50 4.93, p95 6.07), 180.1 req/s at concurrency 20
- FrankenPHP worker mode: mean 6.04 ms and 156.4 req/s (RSS 126.5 MB); a second run with 4 workers gave mean 4.96 ms and 151.0 req/s (RSS 144.5 MB)
That is about 10.9x on latency and about 11.4x on throughput for Go vs classic PHP. Worker mode did not close the gap in my runs, and it did not beat classic mode here either, which surprised me.
Limits: one trivial endpoint, so this mostly shows framework overhead. Concurrency 20 on one CPU is a small load, not a stress test. One hardware size, one run set, my own settings, and I did not tune worker count or PHP settings beyond what I listed. Real apps spend most of their time in queries and I/O, so I would not expect 11x on a real app.
If anyone has run worker mode on Laravel with different results, I'd like to know what settings you used.
r/PHP • u/Worried_Librarian_79 • 2d ago
Standard identifiers for PHP
php-stdnum.orgI've released php-stdnum, an MIT-licensed PHP library for working with standardized identifiers.
The initial release includes:
- 606 validators covering VAT numbers, tax identifiers, IBANs, national identifiers, company registration numbers, ISBNs, postal codes and more.
- 594 native deterministic test-data generators.
- Validation, normalization, formatting and scoped detection.
- Immutable value objects and typed validation errors.
- Optional Laravel, Symfony, Doctrine and FakerPHP integrations.
- PHP 8.3–8.6 compatibility.
Documentation: https://php-stdnum.org/
GitHub: https://github.com/php-stdnum/php-stdnum
I'd appreciate technical feedback. Thank you!
r/PHP • u/Sensitive-Training22 • 2d ago
Speed Demon II: an online race to make PHP fast with the OPcache JIT off (29 Jan to 1 Feb)
I organise this one (Hackathon Raptors, a UK nonprofit), so take it as an announcement.
Speed Demon II is an optimisation race in 26 slow languages, and PHP is one of them. The rules for PHP: the Zend VM with the OPcache JIT off, no C extensions. Whatever speed you get comes from the PHP code.
The four tasks are log aggregation (310k lines, p50/p95/p99 per endpoint and hour), a search index with 5k queries, a join over a hostile CSV, and shortest paths on a 500k-edge graph. Every entry is timed against a naive version in the same language, so PHP competes with PHP, not with C. One machine runs every entry, one run at a time.
Free, teams of 1 to 4, $2,000 in prizes. Each push sets the speed of your team's car in a live 3D race around San Francisco: https://speeddemon.dev/2027/img/r-start-1920.jpg
r/PHP • u/Positive-Ring-5172 • 3d ago
Discussion PHP Engine in Go or Rust instead of C
I've considered a couple of times making an April Fool's announcement of this, but the recent Laravel discussions got me to thinking - what would be the tradeoffs. Would the engine run faster? Would it be worth it?
r/PHP • u/Normal_Tadpole_8061 • 3d ago
Kinetis Vector 1.0
Hey r/PHP,
I've been building Kinetis for a while: an MIT-licensed PHP framework built from day one around persistent workers. Your app boots once and serves lots of requests instead of rebuilding itself on every one. The core is non-blocking and built on native Fibers, so when a request is waiting on the DB or an HTTP call, it steps aside and the other requests keep moving. It's a full framework (routing, validation, OpenAPI, auth, queues, a native MCP server and so on, split into packages you only install when you need them), and the same code runs on PHP-FPM, FrankenPHP, RoadRunner or Lambda.
Today I shipped Vector 1.0, the admin side of it. The idea is simple: you write a resource over your entity in plain PHP, and from that one definition Vector serves:
- an admin API
- a complete admin UI (dashboards, lists, calendars, boards, forms, actions, an audit trail)
- MCP tools, so AI agents can work with your data
Your policies are enforced on every request, whichever of those three it comes through. There's also an optional AI add-on if you want that.
The easiest way to get it is the 7-minute demo video in the post, which walks through a small sample store from the first resource all the way to the AI stuff.
If you want to play with it, Docker is the only requirement:
composer create-project --no-install kinetis/vector-demo vector
Blog post + video: https://kinetis.dev/blog/posts/kinetis-vector-1-0.html
Docs: https://kinetis.dev/vector/docs/
GitHub: https://github.com/kinetis-dev/vector
Everything's MIT. I'd really like feedback, including the harsh kind. What would stop you from using this over what you've got now?
r/PHP • u/davidbalbino • 3d ago
I rebuilt crawl4ai in PHP: ~20× faster web → Markdown for LLMs, typed extraction, no browser needed
Hey r/PHP 👋
I've been using crawl4ai (the popular Python crawler for LLM/RAG pipelines) and wanted the same thing natively in PHP. So I built PAM Crawl: it covers all of crawl4ai's features, with a different engine underneath.
The idea: crawl4ai opens a browser for every page. Most pages don't need one. PAM Crawl speaks HTTP/2 directly (curl_multi), parses with PHP's native HTML5 parser (Dom\HTMLDocument), and only renders JavaScript when a page actually needs it.
📊 Numbers
460 real pages served from a local nginx, each one turned into Markdown + main-content Markdown + links + media:
• pam-crawl, 8 worker processes: 448 pages/s, 418 MB peak RAM
• pam-crawl, 1 process: ~150 pages/s, 94 MB
• crawl4ai, HTTP mode: 7.9 pages/s, 525 MB
• crawl4ai, browser mode (default): 6.3 pages/s, 3.8 GB
The methodology and benchmark scripts are in the repo, so you can reproduce it.
🧑💻 What it looks like
// clean Markdown for RAG
$page = Crawl::url('https://www.php.net/manual/en/function.array-map.php')->get();
echo $page->content->raw; // main content only
echo $page->markdown(focus: 'callback'); // BM25: just the relevant sections
// typed extraction straight into your own classes
#[Item('article.product_pod')]
final readonly class Book {
public function __construct(
#[Css('h3 a', attr: 'title')] public string $title,
#[Css('.price_color'), Money] public int $cents,
#[Css('.availability')] public bool $inStock,
) {}
}
$books = Crawl::url('https://books.toscrape.com/')->get()->extractAll(Book::class);
// deep crawl, prioritized, polite
Crawl::site('https://docs.example.com')
->only('/docs/*')->depth(3)->limit(200)
->prioritize(Score::keywords('auth', 'tokens'))
->respectRobots()
->each(fn (Page $p) => $index->add($p->content->raw));
✨ Highlights
• Built for LLMs: clean Markdown, main-content extraction, BM25 focus, citations, chunking.
• Typed extraction with attributes, with fallback chains like #[Css('.price'), JsonLd('offers.price'), Money]. crawl4ai's JSON CSS/XPath schemas also work unchanged.
• LLM features: extraction into DTOs, schema generation, Q&A with citations. Works with OpenAI, Anthropic, Gemini or a local Ollama. "Learn once" mode: the LLM writes the selectors on the first page, and every later page runs without it.
• JavaScript apps without a browser: it reads Next.js/Nuxt/Remix hydration data and finds the JSON APIs behind a page. When you truly need rendering, the optional pam-crawl-browser plugin uses Lightpanda (~42 MB for 8 tabs) or Chrome (screenshots, PDF, logins), only for the pages that need it.
• Crawling: BFS/DFS/best-first, sitemap and Common Crawl seeding, domain mapping, adaptive crawling ("stop when the question is answered"), robots.txt, per-host politeness, HTTP cache with ETag revalidation.
• Interfaces: crawl CLI (crwl-compatible), crawl4ai-compatible HTTP API, MCP server for AI assistants, Docker image.
• Extras crawl4ai doesn't have: change monitoring with diffs, near-duplicate detection, multi-process ->workers(8), PDF parsing in pure PHP.
It runs on plain PHP 8.5 and works best on PAM (https://github.com/push-in/pam), a persistent PHP runtime where connections, caches and extraction plans stay warm between requests. PHPStan level 9, ~370 tests, Apache-2.0. Full credit to crawl4ai for the original design.
🚀 Try it
composer require pushinbr/pam-crawl
• Repo: https://github.com/push-in/pam-crawl
• 28 runnable examples: https://github.com/push-in/pam-crawl/tree/main/examples
• Browser plugin: https://github.com/push-in/pam-crawl-browser
It's a 0.1 release, so I'd love feedback, especially on the API design and on sites where the Markdown or main-content extraction comes out wrong. Happy to answer questions!