PHP Reddit – Telegram
PHP Reddit
34 subscribers
294 photos
39 videos
25K links
Channel to sync with /r/PHP /r/Laravel /r/Symfony. Powered by awesome @r_channels and @reddit2telegram
Download Telegram
LDAP get Members of a Group

Hey,

I need a function to get all Members of a Group using the Symfony LDAP Adapter.

Cheers

Christoph

https://redd.it/1r4tky0
@r_php
Sugar (PHP templating engine) — thoughts?

Hey everyone

I’m working on a new PHP templating engine called Sugar, and I’d love honest feedback from the community.

It’s something I’ve wanted to try for a long time, and with today’s AI tooling this kind of project feels way more accessible for me to actually build and iterate on.

Docs: https://josbeir.github.io/sugar/
GitHub: https://github.com/josbeir/sugar
Feature comparison: https://josbeir.github.io/sugar/guide/introduction/what-is-sugar.html#feature-comparison (could be incorrect, please correct me if you notice this)

Focus

Directive-based templating (`s:if`, `s:foreach`, `s:forelse`, etc.)
Context-aware auto-escaping
Components + slots
Template inheritance/includes
PHP 8.5 pipe syntax support (even with the minimum PHP 8.2 requirement)

Feedback I’m looking for

Does the syntax feel intuitive?
Anything that feels over-engineered or unnecessary?
Missing features you’d expect before real-world use?
Docs clarity — what was confusing?
Performance or architecture concerns you notice?

I’m especially interested in critical feedback — but “looks good” is appreciated too 🙏

Thanks for taking a look!

https://redd.it/1r4gpzz
@r_php
Xampp in 2026.

I have been using PHP and Laravel for many years and recently started taking my setup more seriously.

Right now on my Mac I am still using XAMPP for local development. It works fine, but I keep seeing people recommend other tools like Valet, Herd, Docker, etc.

I also sometimes work on plain PHP projects, not just Laravel, so flexibility matters to me.

For those using Mac in 2026, what is your current local setup for PHP and Laravel?

Are you using Valet, Herd, Docker, or something else?

What would you recommend as the best and most efficient setup today?

https://redd.it/1r58lxd
@r_php
How is ZED for PHP ? Anyone moved from Phpstorm to zed ?

I have been a phpstorm user for years. While I am quite happy with it, the performance of zed is something else. My PC is decent and I don't really have a performance issue with phpstorm on most days.

But zed is not merely fast, its in a different league. It feels like a modern application with old school like lightning light UI. Like how the earlier versions of firefox were. Like xfce or how snappy windows xp was . Currently its taking only 120 MB of RAM with a project open!


But performance is not everything. Phpstorm is a professional almost perfect for php. Zed is great, but lacks the default perfect php experience of phpstorm - things like context, jumping to definition, autocomplete etc. To make zed match phpstorm we need some paid extensions

\- 'php tools' - yaerly cost. Almost as expensive as phpstorm !
\- intelliphense - one time. Cheaper, less powerful.

Anyone has experience with either ? Anyone moved from phpstorm to zed and found it good ? Worth trying , or buying these extensions ?

https://redd.it/1r59xkm
@r_php
Kreuzberg v4.3.0 and benchmarks

Hey all,

Excited to announce that we published updated benchmarks for Kreuzberg, comparing it against other document extraction tools like Apache Tika, Docling, Unstructured, PDFPlumber, PyMuPDF4LLM, MarkItDown, and Mineru. We want to help you understand how Kreuzberg behaves in practice. We also released Kreuzberg v4.3.0 which has a lot of new cool improvements (more below)!

What is Kreuzberg?

Kreuzberg is an open-source document intelligence framework written in Rust, with Python, Ruby, Java, Go, PHP, Elixir, C#, and TypeScript (Node/Bun/Wasm/Deno) bindings. It focuses on fast, structured extraction across 75+ formats, including PDFs, Office docs, HTML, images, and more.

All benchmarks run automatically on GitHub Actions in a standardized Linux environment. Every framework is tested using the same harness.

We measure: Throughput (MB/s), Duration: extraction time per document, Quality Score: Extraction accuracy, Extraction time vs subprocess overhead, Memory usage RAM consumption, CPU usage, Tail latencies (p95 / p99)

Benchmarks run in both:

Single-file mode (latency, cold start)

Batch mode (throughput, parallelism)

Runtime characteristics

In addition to extraction performance, we also measure:

Cold start time (framework initialization latency) and Installation footprint (framework install size on disk)

High-level results show that:

Kreuzberg shows significantly higher throughput across PDFs, DOCX, PPTX, and HTML

Processing times are in milliseconds instead of seconds

Cold start times are much lower compared to alternatives

Installation footprint is smaller than other frameworks

All results are generated in CI, published as structured JSON and fully reproducible.

More updates: Kreuzberg 4.3.0 is out

Alongside the benchmarks, we’ve continued shipping improvements and fixing issues. Key highlights: PaddleOCR optional backend - in Rust, Document structure extraction (similar to Docling), Native Word97 format extraction - valuable for enterprises and government orgs

Find all info in our GitHub Changelog here: https://github.com/kreuzberg-dev/kreuzberg/blob/main/CHANGELOG.md

Contributions are welcome :)



https://redd.it/1r5a4a0
@r_php
Does anyone here prefer PHPUnit to Pest?

This question was asked here 3 years ago and the response then was uniformly a preference for PHPUnit and especially a dislike for its syntax. A typical comment was the observation that "Pest is just Jest for PHP... and I hate Jest".

Since then I know Pest has progressed to include in-browser testing, but how does the community feel about Pest now?

https://redd.it/1r5j9ea
@r_php
Anybody try replacing PHPStan/Pint/Rector Et al. with Mago?

I have a pretty large production codebase that I've setup with PStan, Pint, Rector in CI which I was thinking about migrating to Mago over the weekend to test out:

https://mago.carthage.software/

Not exactly sure it can replace all of those (Pint?) it's just been on my backlog for so long, I haven't even had the time to look into it that far -- just thinking about carving up some time to do so.

Thought I might do some due diligence first before I sink a full Saturday into this. Has anybody played around with it, run into issues, or generally have any advice?

https://redd.it/1r3sdz7
@r_php
Weekly /r/Laravel Help Thread

Ask your Laravel help questions here. To improve your chances of getting an answer from the community, here are some tips:

What steps have you taken so far?
What have you tried from the documentation?
Did you provide any error messages you are getting?
Are you able to provide instructions to replicate the issue?
Did you provide a code example?
Please don't post a screenshot of your code. Use the code block in the Reddit text editor and ensure it's formatted correctly.

For more immediate support, you can ask in the official Laravel Discord.

Thanks and welcome to the r/Laravel community!

https://redd.it/1r5l9yg
@r_php
Kotlin-style List/Set/Map for PHP 8.4 - Mutable/Immutable, change tracking, key preservation, live map views, and generics support

Hello, so I've been working on a collection library for a few months (over the weekends), and I have finally decided to release it as the beta 0.1, as I consider the API to be relatively stable, and I would like to release a few 0.x versions during 2026 before committing to 1.0.

Docs: [https://noctud.dev](https://noctud.dev)
GitHub: **https://github.com/noctud/collection**

Why another collection library?

I've tried several existing libraries, but none of them solved the typical PHP headaches. Most are just array wrappers that provide a nicer API (which is often inconsistent). The main problems I wanted to solve were:

PHP arrays silently casting keys ("1" becomes int(1), true becomes 1).
You can't use objects as keys.
Filtering leaves gaps in indices.
There's no real API.
Enforcing array<string, something> is impossible if you don't control the data source.

I thought it would be a few days of work. It turned out to be a \~6 month project.. the more I worked on it, the more work I saw ahead.

What came out of it:

List, Set, Map - each with mutable and immutable variants
Key-preserving Maps - "1" stays string, true stays bool, objects work as keys
Full generics - PHPStan level 9, every element type flows through the entire chain
Mutable & Immutable - immutable methods return new instances marked with #\[NoDiscard\] (PHP 8.5 will warn on discarded results)
Change tracking - $set->tracked()->add('x')->changed tells you if the mutation actually did something
Lazy initialization - construct from closures, materialized on first access via PHP 8.4 lazy objects
Copy-on-write - converting between mutable/immutable is virtually free
Map views - $map->keys, $map->values, $map->entries are live collection objects, not plain arrays, and they share memory space
PhpStorm plugin - fixes generic type inference in callbacks and __invoke() autocomplete, I fixed a bug regarding \_\_invoke and added support for features not natively available.

Regarding PhpStorm bugs: I've reported several issues specifically related to static return types (most of them are Trait-related). As a result, I avoided using static completely to ensure method chaining autocomplete works correctly in the IDE. The only rule for third-party extensions is that Mutable collections (their mutable methods) must return $this. This is standard practice and doesn't necessarily require static enforcement, though this may change in the future.

Quick taste:

$map = mutableMapOf('a' => 1, 'b' => 2, 'c' => 3);
$map->values->sum(); // 6
$map->keys->sorted(); // ImmutableSet {'a', 'b', 'c'}
$map->filter(fn($v) => $v > 1)->keys; // Set {'b', 'c'}
$map'd' = 4;

$list = listOf(3, 1, 4, 1, 5);
$list->distinct()->sorted(); // 1, 3, 4, 5
$list->partition(fn($n) => $n > 2); // [3, 4, 5, 1, 1]

// StringMap enforces string keys even if constructed from array<int, string>
$map = stringMapOf('1' => 'a');
$map->keys; // Set {'1'}
$map->keys->firstOrNull(); // "1"

I don't want to make this post too long, I've tried to make a nice presentation on the docs homepage, and all the details and design decisions can be found in docs, there is even a dedicated page about the design, as well as an FAQ where I try to compare it to Java/Kotlin collections and explain why I made certain decisions.

It's built on top of Kotlin/Java foundations, with some nice adjustments - If the Java/Kotlin maintainers could rebuild their collections from scratch, I think it would look something like this, because Java "messed up" the
Mutable/Immutable split, Kotlin added immutable collections later as a library.

I plan to refactor the tests soon.. the Map tests were written early on, before StringMap and IntMap were fully implemented and now it doesn't click perfectly, and I also plan on adding Lazy collections as a Sequence later this year.

Feedback is welcome! This is the first public release and my first serious open source project. The target audience is mainly developers using high levels of static analysis, as well as library authors who could benefit from the interface-driven design (only interfaces are exposed; implementations are hidden and swappable).

Docs: https://noctud.dev
GitHub: https://github.com/noctud/collection
PhpStorm plugin: plugins.jetbrains.com/plugin/30173-noctud

https://redd.it/1r5oten
@r_php
Weekly Ask Anything Thread

Feel free to ask any questions you think may not warrant a post. Asking for help here is also fine.

https://redd.it/1r5zn07
@r_php