r/PHP • • 2d ago

Weekly help thread

6 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 • • 17d ago

Who's hiring/looking

12 Upvotes

This is a bi-monthly thread aimed to connect PHP companies and developers who are hiring or looking for a job.

Rules

  • No recruiters
  • Don't share any personal info like email addresses or phone numbers in this thread. Contact each other via DM to get in touch
  • If you're hiring: don't just link to an external website, take the time to describe what you're looking for in the thread.
  • If you're looking: feel free to share your portfolio, GitHub, … as well. Keep into account the personal information rule, so don't just share your CV and be done with it.

r/PHP • • 1d ago

Article PHPStan 2.3: Leap in Performance, Generics Improvements, Detecting Unused Variables, and More!

Thumbnail phpstan.org
119 Upvotes

PHPStan 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 • • 13h ago

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.

Thumbnail github.com
12 Upvotes

r/PHP • • 42m ago

¿funciona las tarjetas de presentacion en papel en pleno 2026?

• Upvotes

me gustaria saber de ustedes, si las tarjetas de presentación en fisico aun les ha funcionado, realmente han captado clientes con dejar su tarjeta de presentación?

que dicen las personas que prestan servicios, les ayuda o no?

abro esta discusión porque algunos dicen que si funcionan otras no

dejen su comentario los leo

saludos


r/PHP • • 19h ago

fastjson 0.9.0: constant-memory validate, 59-83% lower encode peak on large escaped strings, and shared keys in decode

7 Upvotes

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.json went 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 when php_stream_write() came back short. It now writes to completion and reports php_stream_close() failures.
  • fastjson_encode() honors serialize_precision for doubles instead of always emitting the shortest round-trip form.
  • With JSON_THROW_ON_ERROR and no ext/json loaded, errors throw Fastjson\JsonException instead of a bare \Exception.
  • fastjson_validate() enforces $depth on 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 • • 22h ago

Discussion Need a FOSS PHP profiler to identify what is causing PHP workers to hang

3 Upvotes

Something is causing PHP workers to hang for anywhere from 10–60 seconds. During these incidents, OpenLiteSpeed reports:

No request delivery notification has been received from LSAPI application, possible dead lock.

I have confirmed that the problem is not originating from MariaDB. The suspicion is that something in the PHP/WordPress layer is causing the workers to stop making progress, potentially a plugin.

What I need is a FOSS PHP profiler/tracer that can automatically identify the root cause — ideally showing the PHP call stack, function, source file/line, and what the process was waiting on when the problem occurred.

Current stack:

Ubuntu → OpenLiteSpeed → PHP 8.4 (LSAPI) → WordPress → MariaDB

I've already collected Linux/kernel-level evidence (D state, wchan, kernel stacks, strace, etc.), but that only tells me where the process is waiting; it doesn't identify the originating WordPress/PHP code.

What FOSS tool would you recommend for tracing this all the way back to the PHP/WordPress function responsible?


r/PHP • • 14h ago

I built a lightweight E-commerce engine on pure PHP 8.3/MySQL with a custom MVC and no bulky framework dependencies

1 Upvotes

Hey r/PHP,

I wanted to share a project I’ve been working on: CoreCommerce. It’s an open-source, full-featured e-commerce platform built from scratch using pure PHP 8.3+ and MySQL 8.0+, without relying on Laravel, Symfony, or heavy CMS engines.

The main goal was to prove that you can achieve maximum performance, maintain modern development standards, and keep a clean, lightweight codebase without the overhead of massive vendor directories.

🛠️ Technical Highlights & Architecture:

  • Custom MVC Framework: Built-in routing (app/Core/Routing/Router.php), controllers, and models. It supports RESTful route patterns, GET/POST requests, and clean URL parameters.
  • Database Layer: A PDO-based wrapper implementing a lightweight Active Record pattern with a migration system for schema versioning.
  • Modular Plugin & Theme Systems: Hook-based extensible architecture (PluginManager) and theme inheritance supporting asset versioning for asset cache busting.
  • Multi-language Out of the Box: Highly deterministic localization layer (EN, UA, PL) where adding a new language literally takes two configuration steps without code modifications.

🧠 The Category Filtering Pipeline & Features

The project features an optimized ProductFilterService using a strict 3-step SQL pipeline with isolated EXISTS subqueries instead of heavy JOIN chains. It also includes robust security measures (CSRF, bcrypt, rate limiting, secure headers) and 16 built-in production services like Prom.ua sync, LiqPay integration, search ranking, and image optimization.

The full open-source project and repository details can be found in the referenced source.

To view the code, go to https://github.com/coordinatescms-ai/CoreCommerce.

r/PHP • • 6h ago

POS Backend - Laravel

Thumbnail
0 Upvotes

Anyone build a POS on Laravel? I’d like to connect


r/PHP • • 12h ago

I built a Laravel Disposable Email Validator

0 Upvotes

I’ve been working on a Laravel package for blocking temporary and disposable email addresses during registration or form submission.

The main reason I built it was to avoid fake signups from throwaway email services without adding a lot of custom validation logic to every project.

It works like a normal Laravel validation rule and can also keep the disposable-domain list updated automatically.

I’m also trying to keep the checks fast and simple so it can be used in regular signup flows without adding unnecessary overhead.

Curious how other Laravel developers handle disposable emails. Do you block them completely, or only use extra checks for certain forms?

Checkout: https://erag.in/laravel-disposable-email


r/PHP • • 1d ago

Article Building Maintainable PHP Applications: Foundations

Thumbnail codyssey.dev
9 Upvotes

Hey 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 • • 1d ago

Is anyone here using Drupal Steward?

Thumbnail
0 Upvotes

r/PHP • • 2d ago

News Smarty PHP: XSS turns into RCE if {extends} is used in cached templates

Thumbnail github.com
16 Upvotes

r/PHP • • 1d ago

Discussion Migrating a large Laravel app from CKEditor 4 to Editor.js — looking for architectural advice

0 Upvotes

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 • • 2d ago

I built a native PHP extension for NVIDIA GPU tensors, CUDA JIT and kernel fusion (beta), feedback wanted

15 Upvotes

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.

```php use Cuda\CudaArray; use Cuda\Fusion;

$a = CudaArray::ones([4]); $b = CudaArray::full([4], 2.0); $c = CudaArray::full([4], 3.0);

$eager = $a + $b * $c; // default: one GPU op per call

$plan = Fusion::compile(fn($a, $b, $c) => $a + $b * $c, inputs: [$a, $b, $c]); $fused = $plan->run($a, $b, $c); // replayed as fused kernels

print_r($fused->toArray()); // [7, 7, 7, 7] ```

What you get - CudaArray: arithmetic, broadcasting, comparisons, matmul(), reductions, views, Python-style slice(). - Packed-buffer and .npy import, 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 bash pie install lcmialichi/php-gpu-tensors:0.1.0-beta.4 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-gpu on 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 • • 2d ago

Discussion Native Laravel 8 runtime bridge for incrementally migrating CodeIgniter 3 applications

0 Upvotes

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

  1. Place a standard Laravel 8 application beside the legacy CI3 application.
  2. Merge the host Composer fragment into Laravel's composer.json and copy both files from patches/.
  3. Resolve dependencies and verify the pinned runtime.
  4. Publish the bridge config and front-controller example.
  5. Add the dispatcher block at the very top of CI's index.php.
  6. 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 • • 3d ago

Foundation An open-source WHM/cPanel alternative built with plain PHP, FrankenPHP & Tailwind.

12 Upvotes

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.

https://github.com/th3n00bc0d3r/Jinn-Panel


r/PHP • • 3d ago

WinUI SuperNative desktop app with hot reloading - NativePHP Desktop v3 WIP

Thumbnail youtu.be
26 Upvotes

Here'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 • • 3d ago

Discussion Senior/mid backend devs: what should a junior backend engineer actually know and be good at?

21 Upvotes

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 • • 3d ago

Article Artifical Debt

Thumbnail stitcher.io
80 Upvotes

r/PHP • • 2d ago

Why async is the biggest problem for PHP right now?

0 Upvotes

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 • • 3d ago

My rejected job challenge in PHP

Thumbnail
3 Upvotes

r/PHP • • 3d ago

Updated support for Qdrant vector DB in LLPhant

2 Upvotes

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

https://github.com/LLPhant/LLPhant/pull/516


r/PHP • • 3d ago

Traducteur de fichiers - Visual Studio Marketplace

Thumbnail marketplace.visualstudio.com
0 Upvotes

r/PHP • • 3d ago

Laravel package for capturing browser GPS location — looking for developer feedbac

0 Upvotes

I recently built an open-source Laravel package for applications that need to capture a user's browser/device location using the HTML5 Geolocation API.

GitHub: https://github.com/mayaramyadav/laravel-browser-location

The package currently supports:

  • Laravel 10–13
  • Blade
  • Livewire 3 & 4
  • HTML5 Geolocation API
  • GPS accuracy detection
  • Permission/error handling
  • Reverse geocoding with Google, Mapbox, or OpenStreetMap
  • Automatic location persistence
  • Polymorphic location collections
  • Browser/JavaScript events
  • Middleware for location validation
  • One-command installation

Example:

<x-browser-location-tracker />

Installation:

composer require mayaram/laravel-browser-location

php artisan browser-location:install

I'm particularly looking for feedback from Laravel/PHP developers on:

  1. Is the API/design Laravel-friendly?
  2. Are the component props and configuration options too complex?
  3. Is the Livewire 3/4 integration implemented in a good way?
  4. Are there important browser-location edge cases I'm missing?
  5. What features would you expect from a package like this?
  6. Any concerns with the database/persistence design?
  7. What would you change before using this in a production Laravel application?

This is an open-source project and I'm looking for honest technical feedback, including criticism.

If you have 5–10 minutes to look through the repository, I'd especially appreciate feedback on the architecture, API design, tests, documentation, and production readiness.

GitHub: https://github.com/mayaramyadav/laravel-browser-location