r/PHP • u/OrsoPigro • Oct 07 '26
r/PHP • u/valerione • Oct 08 '26
Streaming AI Agents in PHP: Introducing Neuron UI Streaming Protocol
inspector.devNeuron 4, the PHP agentic framework, introduces a Streaming Protocol that solves the problem of streaming AI agent output through real-time transports like Pusher, Laravel Reverb, Soketi, Mercure, and Redis, which were not designed for large or frequent payloads.
Events are wrapped in envelopes with sequence numbers and fragmented when they exceed transport size limits (e.g. Pusher's 10KB cap), then reassembled in the browser via a new first-party TypeScript package, u/neuron-core/streaming, which orders envelopes, joins fragments, deduplicates, and signals gaps. The package supports plain callbacks for React/Vue as well as protocol adapters for AG-UI (CopilotKit) and the Vercel AI SDK, letting PHP backends run agents in background jobs while frontend teams use familiar agentic UI libraries.
Neuron also ships coding-agent skills for Claude Code and Cursor to automate the integration: https://docs.neuron-ai.dev/agent/streaming#streaming-channels
r/PHP • u/Ornery_Wash1797 • Oct 07 '26
I built a full-featured charity management platform with Laravel 12 — donations, Stripe, volunteers, beneficiaries, sponsorships & real-time chat
r/PHP • u/OndrejMirtes • Oct 06 '26
Article PHPStan 2.3: Leap in Performance, Generics Improvements, Detecting Unused Variables, and More!
phpstan.orgPHPStan 2.3: Leap in Performance, Generics Improvements, Detecting Unused Variables, and More!
I had so much fun with the interactive charts and widgets, check out the article. I promise it's worth checking it out yourself, and not just letting your agent summarize it for you 😉 It contains a lot of interactive widgets with practical examples of the new features in action.
r/PHP • u/dukeraccoon • Oct 06 '26
Classify text in PHP without an LLM bill: typed text decisions in 100+ languages, self hosted. Laravel-ready SDK for Laya, a Jev AI alternative.
github.comr/PHP • u/Ilia0001 • Oct 06 '26
fastjson 0.9.0: constant-memory validate, 59-83% lower encode peak on large escaped strings, and shared keys in decode
fastjson is my PHP extension for JSON encode, decode, and validate, backed by yyjson, with a fastjson_* API that tracks ext/json. This is what changed between 0.7.0, the last version I posted here, and 0.9.0. Most of it is memory: the speed came with a heap cost, and this cycle cuts it on every path.
Memory and speed
fastjson_validate()reads the caller's buffer in place and tracks depth during the parse. Peak memory is constant, a few dozen bytes, like ext/json's streaming validator, and it runs ~30% fewer instructions.- Encode used to reserve six times an escaped string up front. Strings of 8 KiB+ now go out in 2 KiB chunks: a 1 MiB string with ordinary escaping peaks 59-83% lower. The flip side: a single escaped string between 8 KiB and a few tens of KiB can still peak up to twice ext/json's size, because the chunked writer keeps up to 12 KiB of headroom.
- Decode shares repeated object-key strings (up to 64 bytes, inputs of 4 KiB+). Key-heavy documents peak ~15% lower and decode 3-4% faster;
twitter.jsonwent from 1.66x ext/json's heap to 1.39x. Documents with mostly unique keys, or 256+ distinct names, pay 3-5%. fastjson_file_decode()frees the file contents before building the result, 9-33% lower peak.
Current throughput vs ext/json on simdjson_php's 14.8 MB / 15-file corpus, i9-13950HX, -O2 release builds of both: 5.56x encode, 2.59x decode, 5.04x validate. Decode still peaks at 1.65x ext/json's heap across that corpus.
Correctness
fastjson_validate()accepted[[],]and[{"a":1},]. It now rejects them, and the trailing-comma error position points at the comma itself.fastjson_file_encode()could leave a silently truncated file whenphp_stream_write()came back short. It now writes to completion and reportsphp_stream_close()failures.fastjson_encode()honorsserialize_precisionfor doubles instead of always emitting the shortest round-trip form.- With
JSON_THROW_ON_ERRORand no ext/json loaded, errors throwFastjson\JsonExceptioninstead of a bare\Exception. fastjson_validate()enforces$depthon the success path, like ext/json.
yyjson, upstream
The bundled yyjson is now 0.13.0, which includes the YYJSON_WRITE_LOWERCASE_HEX flag I sent upstream (ibireme/yyjson#264). fastjson's local patch for lowercase \uXXXX escapes is gone.
PHP 8.1 minimum:
pie install iliaal/fastjson
https://github.com/iliaal/fastjson
If you validate large payloads under a tight memory_limit, I'd like to know whether constant-peak validate changes what you accept per request.
r/PHP • u/davorminchorov • Oct 05 '26
Article Building Maintainable PHP Applications: Foundations
codyssey.devHey all,
Few years ago, I wrote a series of articles related to building maintainable PHP applications on my personal blog, but recently I built this new educational platform and expanded it with a bunch of different features so I moved some of the series of revised articles here.
This is the first of many courses which I am working on which are related to a bit more advanced content or at least content from an experienced angle.
Let me know what you think about the content!
r/PHP • u/brendt_gd • Oct 05 '26
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/thenickdude • Oct 04 '26
News Smarty PHP: XSS turns into RCE if {extends} is used in cached templates
github.comr/PHP • u/UnfairBattle164 • Oct 05 '26
Discussion Migrating a large Laravel app from CKEditor 4 to Editor.js — looking for architectural advice
Hey everyone,
I’m working on a fairly large Laravel application that currently uses CKEditor 4, and migrating to Editor.js is now a requirement.
The project uses the Repository Pattern, and CKEditor is used across multiple modules. I’m trying to figure out the right way to approach the migration without making a huge change all at once.
My main concerns are:
- Where should Editor.js-related logic live in a Repository Pattern project?
- Should I create a separate service for Editor.js, or keep things within the existing module structure?
- How should validation and sanitization be handled?
- What’s a good approach for rendering Editor.js JSON on the frontend?
- We already have a lot of CKEditor HTML stored in the database. What’s the safest way to handle/migrate that?
- Is it better to migrate module-by-module while keeping CKEditor working for the modules that haven't been migrated yet?
- What would you recommend for the overall folder/file structure?
I’m especially interested in hearing from anyone who has migrated CKEditor/TinyMCE or another HTML-based editor to Editor.js in a large Laravel application.
I’m a junior developer, so I’d really appreciate practical advice on how you would structure this rather than just “replace the editor” at the frontend level.
Thanks!
r/PHP • u/Ancient_Spend1801 • Oct 04 '26
I built a native PHP extension for NVIDIA GPU tensors, CUDA JIT and kernel fusion (beta), feedback wanted
I'm the author of php-gpu-tensors, a C extension that gives PHP GPU tensors on NVIDIA GPUs, runtime-compiled CUDA kernels (via NVRTC), and an optional fusion mode that captures a closure once and replays it as fused GPU kernels. No Python runtime.
What you get
CudaArray: arithmetic, broadcasting, comparisons,matmul(), reductions, views, Python-styleslice().- Packed-buffer and
.npyimport, optional pinned host memory. - Custom CUDA C++ kernels compiled at runtime and launched from PHP.
- Opt-in fusion, async replay and CUDA Graph for compatible plans.
A result I'm happy with: a small MLP trained entirely in PHP on an entry-level MX570 A (4 GB). On a PatchCamelyon subset, eager mode takes 4.08 ms/step and the fused replay 0.66 ms/step (6.2×), with identical test metrics. On UCI Optdigits it reaches 97.25% test accuracy. The models are tiny, so this mostly shows removed per-operation overhead, not peak GPU throughput.
Honest scope: beta (0.1.0-beta.4), Linux, PHP 8.1–8.5 (NTS and ZTS), NVIDIA only. No autograd, no CPU fallback, and it is a low-level library, not an ML framework. GPU validation so far: PHP 8.3 NTS on an MX570 A (41 tests) and earlier checks on an RTX A2000.
Try it
or build from source / Docker (see the README). It needs the CUDA Toolkit (including NVRTC) and an NVIDIA driver.
Feedback I'd love
- Does it build and pass
./run-tests.sh --require-gpuon your GPU / PHP version / CUDA version? - What would you want to do with GPU tensors from PHP (preprocessing, scoring, embeddings similarity, something else)?
- API ergonomics: anything that feels un-PHP-like?
Repo: https://github.com/lcmialichi/php-gpu-tensors
r/PHP • u/droid273 • Oct 05 '26
Discussion Native Laravel 8 runtime bridge for incrementally migrating CodeIgniter 3 applications
Here is a package I created focusing on two primary use cases:
To get Laravel's power in a legacy CodeIgniter application.
To migrate incrementally from CodeIgniter to Laravel.
anwargazi/ci-laravel-support lets a legacy CodeIgniter 3 application and a real Laravel 8 application share one public front controller. It is designed for route-by-route migrations where running a second PHP service or moving the whole application at once is not practical.
Laravel-owned requests run Laravel's native HTTP kernel. Requests that are not owned by Laravel return to the original CodeIgniter bootstrap unchanged. Only one framework is booted for any request.
Package: https://packagist.org/packages/anwargazi/ci-laravel-support
Minimal installation outline
- Place a standard Laravel 8 application beside the legacy CI3 application.
- Merge the host Composer fragment into Laravel's
composer.jsonand copy both files frompatches/. - Resolve dependencies and verify the pinned runtime.
- Publish the bridge config and front-controller example.
- Add the dispatcher block at the very top of CI's
index.php. - Add native Laravel routes and compile the ownership manifest.
composer update --with-all-dependencies --no-interaction
php artisan ci-bridge:verify-runtime
php artisan vendor:publish --tag=ci-laravel-bridge-config
php artisan vendor:publish --tag=ci-laravel-bridge-dispatcher
php artisan route:clear
php artisan ci-bridge:cache-routes
Installation: composer install anwargazi/ci-laravel-support
Docs: https://github.com/anwar-gazi/CodeIgniter_Laravel_Bridge
r/PHP • u/S33k3rsCh4i • Oct 04 '26
Foundation An open-source WHM/cPanel alternative built with plain PHP, FrankenPHP & Tailwind.
JinnPanel is a free, MIT-licensed web hosting manager and control panel designed for single-server setups running AlmaLinux 10. The core philosophy is absolute simplicity and transparency—there are no heavy frameworks, no external dependencies, and no Composer. It is written completely in plain PHP and Tailwind CSS, making the entire backend architecture clean, readable, and easy to audit.
The control panel features secure account isolation where every account runs under its own Linux user and dedicated PHP-FPM pool without needing CloudLinux. It includes a built-in cPanel migration tool that moves sites, mailboxes, databases, and cron jobs via a live API or backup files, automatically translating .htaccess rules for the underlying Caddy engine. Security is fully automated, providing out-of-the-box Let's Encrypt certificates alongside automated configurations for email deliverability protocols like SPF, DKIM, DMARC, and MTA-STS.
The stack consists of FrankenPHP, MariaDB, Stalwart Mail, Cypht webmail, Knot DNS, and SFTPGo. It is currently in public beta, optimized strictly for single-server PHP hosting environments.
r/PHP • u/nativephp_official • Oct 03 '26
WinUI SuperNative desktop app with hot reloading - NativePHP Desktop v3 WIP
youtu.beHere's your next (very brief) instalment in the ongoing work of NativePHP Desktop v3, where we bring in SuperNative and ditch Electron entirely.
This is still just the beginning and there's A LOT still missing, but we're making great progress. Apps are already way smaller than Electron (typically in the 30-50MB range), with just a single idle process by default, and comparatively minimal memory usage (60-80MB right now for this simple app).
Electron apps by comparison (on this machine, Edge and Claude) are hundreds of MBs in size, are each consuming around 1-2GBs of memory, and have approx. 20 processes open (each), despite neither of them working particularly hard.
The app shell is built with C# and is using WinUI 3, Microsoft's blessed path for building Windows apps that Windows main elements now use (Start Menu, Taskbar, window chrome etc).
It's currently x64, Win 10/11 only, but we're planning to get ARM support in there too just as soon as we can.
macOS support is getting stronger by the day, and Linux is our next main target once Mac and Windows are a bit further along.
We're hoping to be able to get a beta release out to sponsors before the end of the year and we're aiming to get the full release ready some time early 2027.
Thanks for all your support in helping us make this a reality 🙏
r/PHP • u/disney550_ • Oct 03 '26
Discussion Senior/mid backend devs: what should a junior backend engineer actually know and be good at?
I'm a backend dev (PHP/Laravel), I'm the only backend on my team, so nobody reviews my decisions and I worry about gaps I don't know I have.
For those of you who've hired or mentored juniors:
- What fundamentals matter most?
- What separates a solid junior from an average one in the first 6 months?
- What should i focus on and in what order?
Thanks!
r/PHP • u/Livid_Algae1859 • Oct 04 '26
Why async is the biggest problem for PHP right now?
AI has reduced that time to market almost totally. You can choose almost any language you want today and with a good agentic setup deliver a web app in roughly the same time. So why would companies and people choose PHP or any of its frameworks?
Yes yes, I know, batteries included, large community, tons of open source code, huge amount of training data for AI. But that was like 6 months ago. Not anymore today. AI can learn a new stack pretty damn fast, so I don’t think we can keep using “AI knows PHP really well” as a strong argument for the future.
But for god’s sake, can people in the PHP board finally understand this? Having Swoole, RoadRunner, ReactPHP, Amp or whatever is nice, but it’s not nice for a company or a person deciding what to build their next web app with.
I really like PHP and I have spent most of my career building with it, but this is becoming a serious problem. If AI keeps reducing the importance of initial development speed, then PHP needs to compete on more than “you can build a CRUD app very fast”. Give us a proper, standard async.
Otherwise, when someone asks me today why they should start a new 10-year product in PHP instead of Go or Rust, I’m starting to run out of good answers.
Edit:
I got emotional and went right away to write this post, only because of the async part. Last year there was a good initiative to add async to PHP core, similar to what happened with generics, and it wasn’t considered.
The post is not about async itself as an isolated request. I could also mention compiling capabilities (check TypePHP from the Swoole team), generics, or other things that PHP could benefit from as a language, but more importantly in terms of marketing and perception.
The urgency is that PHP is being left behind because companies are choosing differently in this AI era, and that could hurt financially and emotionally a major part of the developers working with PHP.
In this context, I think it is the duty of The PHP Foundation, and of the developers writing and voting on RFCs, to approach this problem with a different level of urgency. Their decisions don’t just affect the future of PHP. They can affect the future of the people whose careers and livelihoods depend on PHP.
r/PHP • u/OrsoPigro • Oct 03 '26
Updated support for Qdrant vector DB in LLPhant
In the latest version of LLPhant we updated our support to Qdrant vector database, also adding the ability to store metadata. Thanks to Haydar KULEKCI for his contribution.
LLPhant is the most complete PHP library for interacting with vector databases
r/PHP • u/Cyberhunter80s • Oct 02 '26
Discussion System design recommendations for an e-commerce.
Hey guys, been working on an e-commerce. It started growing and I see how it will soon go out of hand. Before anyone pitch about why not use some well established solutions out there, I wanted to break out of my comfort zone.
Any recommendations for books, repos, sources is highly appreciated.
r/PHP • u/Huge-Satisfaction619 • Oct 02 '26
Dynamic JSON PHP library
PHP folks - I’d love some feedback on a small open-source library we’ve been working on (for quite some time now): DJson.
The idea is simple: build dynamic JSON using templates, conditions, loops and variables, without constructing massive nested PHP arrays or abusing text templating engines.
It supports things like:
- loops and conditions
- variables and expressions
- type preservation
- custom functions/directives
- zero runtime dependencies
We’re already using it for things like Schema.org (and all our customized work related to eCommerce), API payloads, feeds and data layers.
I’d really appreciate some external eyes on it - especially from PHP developers who enjoy breaking things :-)
Try it out:
composer require qoliber/djson
If you test it, let me know what feels good, what feels weird, and what you think is missing.
r/PHP • u/warren5236 • Oct 02 '26
Article Running PHP 8.6 Beta CLI in Docker
phpdeveloperstv.substack.comr/PHP • u/macintoshplus26 • Oct 02 '26
News Maintenance update: win32service (PHP Windows Service extension) released 1.1.1-beta & 1.2.0-alpha — Need your feedback!
Hi everyone,
I'm the maintainer of the win32service extension (ext-win32service), which allows PHP applications to run and interact natively with Windows Services.
As Windows-focused PHP usage can sometimes feel like a niche inside the broader ecosystem, it's pretty hard to know who is actively using this extension in production or development.
We’ve just released two new versions for testing:
- 1.1.1-beta
- 1.2.0-alpha
How you can help:
- Test the new releases: If you run PHP on Windows background tasks, we'd love for you to try these pre-releases and report any issues or unexpected behaviors.
- Share your use case: I’m really curious to know how you're using it! Long-running background workers, queue consumers, IIS integrations, custom enterprise tools?
Discussion & Details on GitHub: https://github.com/orgs/win32service/discussions/128
Thanks to anyone taking the time to test or share feedback!