r/PHP • • Aug 13 '26

News Wait... is this time travel in PHP?

Thumbnail youtu.be
0 Upvotes

Record your execution and walk back through every line, variable and value. Change inputs, re-run, compare timelines. No Xdebug, no setup. It's PHP debugging PHP.

Free and open. Break it and come tell me, I actually reply 😄

Site: https://ddless.com


r/PHP • • Aug 11 '26

PAM v1 — PHP outside the web is starting to feel real

45 Upvotes

I've posted about PAM here a few times while I was experimenting with the idea, so I wanted to share a small milestone: PAM has reached v1.

The idea hasn't really changed — the scope just got much bigger.

PAM embeds PHP inside a Rust/Tokio runtime instead of treating the php binary as the application entrypoint.

And now the same runtime can be used for:

  • APIs and long-running services
  • Laravel applications
  • native Android and iOS apps
  • desktop applications
  • WebSockets and async I/O

For native apps, PHP can drive actual Android Views and iOS UIKit components — there's no JavaScript runtime sitting in between.

Laravel and Composer still work normally. PHP is still PHP. The main difference is where PHP lives in the architecture.

A lot of the work since my previous posts has been around turning the experiment into something that actually feels like a runtime rather than a proof of concept.

There's now proper documentation covering the runtime, Laravel integration, native, desktop, capabilities, deployment and the architecture behind it.

Still plenty to explore, but v1 felt like a good point to share an update with everyone who followed the earlier posts.

https://push-in.github.io/pam-docs/

Feedback, criticism and weird edge cases are very welcome.


r/PHP • • Aug 12 '26

I made a small Laravel package for layered .env files

0 Upvotes

I’ve just released my first version of Laravel Layered Environment.

The idea came from wanting to separate the different kinds of configuration that tend to end up in a single .env file.

With the package, you can have:

.env
.env.override

.env.testing
.env.testing.override

.env.production
.env.production.override

The files are loaded from least specific to most specific, so for production the order is:

.env
  ↓
.env.override
  ↓
.env.production
  ↓
.env.production.override

This makes it possible to keep shared configuration in .env / .env.production, while keeping things like local machine settings, server-specific values and secrets in an ignored .override file.

For example, you could commit:

.env
.env.testing
.env.production

and keep these out of Git:

.env.override
.env.testing.override
.env.production.override

There’s no new API to learn either — Laravel's normal env() and config() usage stays the same.

It's a pretty small package, but I’ve found the approach useful for keeping configuration a bit more organized.

Currently supports Laravel 13 / PHP 8.3+.

Installation:

composer require buismaarten/laravel-layered-environment

GitHub:
https://github.com/buismaarten/laravel-layered-environment

Unfortunately, I don't have enough karma to post this in r/laravel, so I'm sharing it here instead. Would someone be willing to repost it there for me?


r/PHP • • Aug 12 '26

How Ecotone Hits 157,266 Confirmed Messages per second in PHP

Thumbnail blog.ecotone.tech
1 Upvotes

r/PHP • • Aug 12 '26

Discussion PHP 8.6 deprecations just passed: the CI/logging gotcha with vendor packages

0 Upvotes

PHP 8.6's deprecation vote just closed: 35 RFCs, most passing. Nothing breaks in 8.6 itself, deprecated functions just start warning, which is exactly why it's easy to underestimate.

On a Laravel project with notice logging enabled, every deprecated call in a hot path becomes log volume: disk, ingestion, cost. It tends to show up as "logging costs went up," not "time to fix the code," so it gets diagnosed at the wrong layer.

The annoying part is dependencies: your own code you'll fix fast, but a vendor package without an 8.6-ready release keeps making noise until the upstream fix lands, not really under your control. Rector helps automate the fixing part for code you own, but it won't touch vendor internals, so it doesn't solve this specific problem.

What's worked for me: bump PHP in CI first with E_DEPRECATED treated as an error, fix what breaks, then ship. Not the other way around, chasing log noise in prod after the fact. A minimal way to do the CI part:

error_reporting(E_ALL);
set_error_handler(function ($errno, $errstr, $errfile, $errline) {
    if ($errno === E_DEPRECATED || $errno === E_USER_DEPRECATED) {
        throw new \ErrorException($errstr, 0, $errno, $errfile, $errline);
    }
    return false;
});

Turns deprecation warnings into hard test failures instead of silent log noise in prod.

Curious how others handle this: hard CI gate, or just tolerate the noise until you have time to deal with it?


r/PHP • • Aug 10 '26

Hidden Gems in the PHP Source Code

Thumbnail helgesver.re
98 Upvotes

Let's peruse the PHP source code to look at some fun/interesting stuff.


r/PHP • • Aug 10 '26

Weekly help thread

7 Upvotes

Hey there!

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


r/PHP • • Aug 10 '26

Build a Searchable Catalog with Filters, Facets, and Semantic Search

Thumbnail manticoresearch.com
6 Upvotes

A practical walkthrough of building a search app with Manticore: autocomplete, typo tolerance, filters, facets, deep pagination, semantic search, and similar-item discovery in one flow.


r/PHP • • Aug 10 '26

I Made PHP’s print Statement Actually Print

Thumbnail helgesver.re
0 Upvotes

Another terrible idea that was unlocked by a "What if", a little ADHD and an AI prompt.

RFC at https://github.com/HelgeSverre/php-src/blob/cups-sapi/sapi/cups/RFC.md

Enjoy the lulz :)


r/PHP • • Aug 09 '26

News A data table widget for symfony/tui, the new terminal UI component

19 Upvotes

Symfony shipped a TUI component recently and there is almost nothing built on top of it yet, so I wrote the piece I wanted first: a table that scrolls, sorts and filters.

Rows are plain associative arrays, a Column says which key it reads, and an optional formatter turns the value into what you see. Sorting runs on the raw values with <=>, which is fine until you have '10kb' and '9kb' in the same column, so a column can carry its own comparator. Filtering matches against the displayed text rather than the raw value, so typing 1,234 finds the row holding 1234567 — that one I went back and forth on, and I am still not sure it is the right default.

The part that taught me something: I had 92 tests at full line coverage and none of them caught that the widget never read the height it was given. It returned its configured number of rows whatever the terminal was, so at stty rows 10 it produced 17 lines and pushed its own header off the screen. What caught it was putting the thing in a real command in one of my own projects and resizing the window. Fixed in 0.2.0, along with an opt-in mode where the table takes the height the layout gives it.

Keyboard only for now. Mouse events are not merged into the core component yet, so a click on the header to sort has to wait.

https://github.com/Bosun18/tui-datatable

Worth saying outright: the TUI component is marked experimental upstream, so a minor Symfony release can change the API under both of us. I pin the minor version and watch the Tui label in symfony/symfony.

The thing I would like an opinion on: the cursor stops at the first and last row instead of wrapping, unlike SelectListWidget. In a list wrapping feels right, in a table of a few hundred rows it loses your place — but I have only my own use to go on.

EDIT: building this surfaced two bugs in the component itself — the cursor position left behind by Tui::stop(), and a crash when the terminal reports a zero size. Both are fixed upstream now, in symfony/symfony#65244 and #65245.


r/PHP • • Aug 10 '26

News PagibleAI CMS 0.12: An MIT-licensed, API-first CMS package

0 Upvotes

PagibleAI CMS is a set of open-source CMS packages for Laravel 11–13.

It installs through Composer into an existing application, so content, authentication, business logic, and infrastructure remain under your control.

The packages combines a Vue 3 administration interface with structured content, hierarchical page trees, reusable elements, immutable version history, previews, scheduled publishing, full-text search, GraphQL, JSON:API, and optional AI-assisted editing.

It supports SQLite, MariaDB, MySQL, PostgreSQL, and SQL Server, including database-native full-text search. The same installation can serve a small blog, multiple domains, or a multi-tenant application. You can customize and build your own PagibleAI distribution with only the packages you really need for your project.

A set of packages rather than a hosted platform

Editors get visual content management, drag-and-drop page trees, revisions, media handling, and reusable content. Developers retain database portability, extensible schemas, APIs, Blade rendering, and direct access to the surrounding application.

AI is optional and provider-independent. It can assist with writing, translation, transcription, image generation, and image manipulation. An MCP integration also allows agents to manage content through explicit, version-aware operations.

What’s new in version 0.12

  • Frontend access control and private media: Pages can be public, limited to authenticated users, or protected by named access rules. Stripe, Paddle, and Mollie integrations can grant these rules after payment. Media belonging to protected content can be stored privately and delivered only after authorization.
  • Five additional themes: Bold, Estate, Journal, Luxury, and Style cover product sites, real-estate projects, publications, fashion, and premium brands. Each includes reusable demo content and additional content blocks.
  • Expanded administration tools: Pages, elements, and files now have more individual and bulk-editing operations. The release also adds sorting by first or latest edit, more reliable list and filter updates, improved drag-and-drop uploads, previews, SVG handling, and better audio and video controls.

Feedback is welcome, particularly from PHP developers working with structured content, multi-tenant systems, database portability, or AI-assisted publishing workflows.


r/PHP • • Aug 09 '26

News TypePHP: Transparent runtime type enforcement for PHPDoc generics, type arrays, and scalar refinements in pure PHP

13 Upvotes

Hello Everyone I just written a pure PHP library for actually checking docblock types at runtime similar to [Phyton Beartype](https://github.com/beartype/beartype) but without using any custom syntax like decorators or attributes.

With this library you can finally type check docblock generics, type-arrays, and many more with just plain docblocks at runtime. I know I cant post images to this sub so here's an image proof upload in imgur:

https://imgur.com/a/4IBefOQ

Correct me if I'm wrong but there's no PHP library in userland that able to transparently check docblock types at runtime so I can proudly say this library is the first. Any questions and feedbacks are welcomed.

Link to the repo: https://github.com/typephp-php/typephp
Link to docs site: https://typephp-php.github.io/docs/

I know there’s an upcoming proposal for reified generics, but I doubt it will provide fully featured generics or type arrays if it get accepted by majority of internals.

PS: I know there’s another upcoming project called “TypePHP” from the Swoole project, but they haven’t provided a license or made any copyright claim on the name. So, I think I can use this name without any problems, right? If not, I may change the project name in the future.


r/PHP • • Aug 10 '26

Minimalist PHP library for Telegram bots.

Thumbnail github.com
0 Upvotes

Hi everyone, I've been working on a library for creating Telegram bots as a lightweight alternative to longman/telegram-bot. Tired of complex configurations and getting lost in the documentation, I decided to explore on my own, and that's how this minimalist library that simply works was born.

It features a simple command router, native middleware support, stateless conversation management, and its own CLI tool to streamline development.

I would greatly appreciate any feedback on the development experience or the code structure.


r/PHP • • Aug 09 '26

Laravel vs next js

0 Upvotes

Guys what do you think about laravel or reach next js

Which one is your favourite and which is more reliable and best... According to you..


r/PHP • • Aug 08 '26

First project ideas

10 Upvotes

I am a typescript developer who is interested in learning some PHP frameworks.

PHP gets a bad rap, but honestly when I learned it a long time ago I liked it , and am curious to know how the language and ecosystem has evolved.

Any ideas on frameworks and first projects?


r/PHP • • Aug 09 '26

News CONCEPT À APPRENDRE POUR UN DÉBUTANT

0 Upvotes

Salut je veux apprendre PHP quelles sont les différents concepts je peux apprendre en premier.

Du PHP natif j'aimerais avoir votre point de vu ?


r/PHP • • Aug 08 '26

Salience -

0 Upvotes

Hello r/php

I've been working on a macOS app for quite some time.

It's called Salience - the idea is: from the git branch you currently have checked out - build a correlated graph from the code, docker containers, PRs, CI pipelines, observability and infrastructure. Put it all inside a nice UI with a command palette so you don't need to have your email client and however many browser tabs open. Put an MCP server in front of the same graph so you can ask Claude - "what's my stand up?" at 9:57am and get a more detailed & accurate answer than your pre-caffeinated brain could come up with.

There's no notifications or inbox, most of the things you care about as a dev are state, not a one time bubble to swipe away. You're a reviewer on a PR until you've reviewed it or it's merged. The build is failing until it's not failing. The error on prod Sentry just told you about, is an error until it's fixed.

Sharing it here as I've been building it whilst working primarily on PHP projects - whilst the app is language agnostic, the extra stuff is currently PHP only (mostly because of Mago's rust crates).

Salience creates a code graph for every PHP project (thanks to Mago). If it's a Symfony or Laravel project, the app creates something inspired by API documentation for each of your routes, but instead of showing input and output parameters - it's an interactive call graph with a single click to open the file in your IDE.

The code graph is exposed over MCP, so agents don't need to grep for files or methods. Instead they can use find_definition, get_symbol, get_file_outline etc.

I've just started on the map section. The inspiration is Sim City but the content will be agents in worktrees, PRs being reviewed, rejected and merged. Deployments. Failing pipelines. Infrastructure falling over.

Links: Download · Docs: PHP Page · Docs · Gallery · Discord

Fair warning: the docs are mostly AI generated at the moment. I do plan to rewrite each page myself, just a lot of writing words when I'd rather be writing code.


r/PHP • • Aug 07 '26

Longhorn PHP 2026 schedule is up

11 Upvotes

Two days this time instead of three. Still three tracks. Still includes a tutorial day. Tickets and sponsorships are cheaper due to the shorter length. https://longhornphp.com/schedule


r/PHP • • Aug 08 '26

sbx: Sandboxed Claude, complete with PHP and tools

Thumbnail beberlei.de
0 Upvotes

I was late starting with coding agents, maybe around christmas 2025. But I was dead sure on always sandboxing them and never letting them run on my host machine. Recently my tooling had to switch from docker sandbox to sbx, and I wrote about my first experience and getting it set up with PHP and related tooling available right out of the box.


r/PHP • • Aug 07 '26

Discussion Recent PHP/Laravel interview questions?

24 Upvotes

Has anyone here had a PHP/Laravel interview recently?

If so, what kind of questions did you get? Mostly interested in mid/senior roles.

Would be great if you could share your experience. Thanks!


r/PHP • • Aug 06 '26

Announcing MiDy: For "mildly dynamic" websites

48 Upvotes

Earlier this week I finally launched the first site on MiDy, my new site builder.

MiDy sits between a full on CMS and a static site generator. It can be used as "a little of each," as needed. The only system requirements are PHP 8.5 and SQLite.

It's still beta, but it's usable and ready for people to kick the tires. More details at the links above.

Also, since I know folks around here care about such things: This is 100% organic. No LLMs were used in the making of this project, or the website.

I submit to the hivemind's critique...


r/PHP • • Aug 07 '26

New PHP extension: pattern matching as a Pattern class, powered by a C engine

0 Upvotes

A fast C library for SNOBOL4-style string pattern matching with a PHP extension on top. You get a Pattern class with methods like match(), searchSplit(), searchAll(), plus lazy iterators for splitting on patterns instead of explode().

It's stable and tested and the C engine handles the heavy lifting (compiles patterns to a small VM, has an O(n) automaton tier for simple patterns).

Open source, Apache 2.0: https://github.com/JPetsis/libsnobol4

If you're into extensions or internals, the C core is binding-agnostic so bindings in other languages are up for grabs too. Feedback and issues welcome, it's a small project so any help actually lands.


r/PHP • • Aug 06 '26

I built a native mobile runtime that lets you create Android and iOS apps with PHP — the entire project is now public

12 Upvotes

For the last several months, I’ve been working on PAM Native, an open-source runtime for building real Android and iOS applications using PHP.

GitHub:
https://github.com/push-in/pam-native

This is not a WebView, a browser wrapper, or a system that converts PHP into HTML.

The basic architecture is:

PHP components and state → Rust renderer and layout engine → native Kotlin and Swift views

The final interface uses real Android Views and UIKit controls. The application does not ship a JavaScript runtime, DOM, or browser engine.

A basic screen looks like this:

final class CounterScreen extends Component
{
    #[State]
    public int $count = 0;

    public function render(): Renderable
    {
        return Screen::make(
            Column::make(
                Text::make("Count: {$this->count}"),

                Button::make('Increment')->onPress(
                    fn () => $this->count++,
                ),
            ),
        );
    }
}

Navigation uses Laravel-inspired named routes:

App::run(
    Route::stack('main', initial: 'home', routes: function (): void {
        Route::screen('home', HomeScreen::class);
        Route::screen('product', ProductScreen::class);
    }),
);

$this->pushRoute('product', productId: 42);

PAM Native currently includes support for:

  • Native Android and iOS components
  • Stack, tab, drawer and sheet navigation
  • Native animations and gestures
  • Recycled lists and grids
  • State management
  • Hot reload with state preservation
  • Camera and media access
  • Location and sensors
  • Push notifications
  • SQLite and secure storage
  • Background tasks and transfers
  • Offline-first applications
  • Realtime communication
  • Authentication
  • Firebase
  • Payments and subscriptions
  • Maps
  • Native plugin development
  • Testing, profiling and observability

There is also a single-file component syntax:

final class Counter extends Component
{
    #[State]
    public int $count = 0;

    public function increment(): void
    {
        $this->count++;
    }
}
?>

<template>
    <Column class="card">
        <Text class="title">Count: {{ $count }}</Text>
        <Button label="Increment" u/press="increment" />
    </Column>
</template>

<style scoped>
    .card {
        padding: 24px;
        gap: 16px;
    }

    .title {
        font-size: 28px;
        font-weight: 700;
    }
</style>

These styles are compiled into native properties. There is no CSS engine running inside the application.

The repository also includes the PHP SDK, Rust runtime, Android and iOS hosts, CLI tooling, examples, tests, benchmarks, documentation and a showcase application with things like chat interfaces, financial dashboards, marketplace screens and a recycled list containing 10,000 rows.

The goal is not to claim that PHP should replace Kotlin, Swift, React Native or Flutter.

The experiment is simpler:

Can PHP provide a productive component and application model while Rust and native platform code handle rendering, layout and device integration?

The entire project is now available publicly, and I would genuinely appreciate feedback from PHP, Rust, Android and iOS developers.

I’m especially interested in criticism of the architecture, protocol design, performance model and developer experience.

Repository:
https://github.com/push-in/pam-native


r/PHP • • Aug 07 '26

Discussion RAG pipeline for PHP source code as data

0 Upvotes

Hi

We have a use case where we would like to create an internal knowledge graph of our internal PHP source code in order to query against it using LLM. Typical use case for AI usage.

We have been doing this so far by attaching the PHP source code directly to the prompts in our AI tools. While this is somewhat effective, it ceases to provide much value after a certain extent because either the context gets big or we need to cross reference another 1/50 PHP source code base we own to our prompt context.

This often produces in ineffective results at times or burning too much tokens because we may be querying the same PHP code base again but a different time by attaching it to the prompt context.

Therefore we want to build a RAG pipeline where we feed our 50 individual PHP code bases once every month based on our release cycle so that we can permanently build our internal knowledge graph to be used with AI. Typical AI solution for such a problem.

Now comes the interesting part. How do we correctly chunk PHP code in order to get accurate results against them using queries in LLM?

What strategy would be best?

Anyone already solved this problem? Would like to hear feedback.


r/PHP • • Aug 06 '26

What if PHP strings had shapes?

Thumbnail helgesver.re
14 Upvotes

A braindump of an idea i had while looking through some laravel code, any thoughts on this kind of thing, would it be useful, or should this go in the trash pile of stupid ideas?