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
Curious where the community stands on this

With PHP 8.x adding typed properties, union types, stricter internal behavior, and deprecating things like dynamic properties, it feels like PHP has been intentionally moving toward stronger typing and predictability over the last several years.

Some folks argue PHP’s strength has always been being loosely typed and flexible, and that stricter behavior should stay optional. Others see the changes as necessary for maintainability, tooling, and large-scale systems.

For those working in modern PHP:
Do you feel PHP is (and should be) moving away from its old “loosely typed magic” toward more explicit, type-safe patterns? Or do you think this evolution is hurting what made PHP great?

https://redd.it/1r9ys21
@r_php
Symfony (no Mercure) + Python Realtime Stack for highly scalable and true E2E WebSocket apps

Over the years, I’ve been tinkering with WebSockets in PHP and Symfony and tried a lot of approaches.

Ratchet and event-loop servers like ReactPHP WS are easy to set up, but they struggle with non-blocking, large-scale connections. Big messages or lots of clients and everything blocks.

Other PHP solutions or extensions like Swoole, usually mix WebSocket handling with business logic, run monolithic PHP processes, and are tricky to scale horizontally. This also makes polyglot client support harder and adds complexity if you want fully self-hosted setups with real, future-proof end-to-end encryption.

Mercure and SSE only go server-to-client, so true bidirectional events require extra HTTP or webhook logic. Pusher and other SaaS solutions are convenient, but your data, presence, and GDPR compliance live externally.

None of these options scale reliably to hundreds of thousands of connections or give you full control over your data flow.

That’s why I built this stack.

Terminator (Symfony-first) lets you integrate WebSockets and webhooks quickly while keeping business logic fully in Symfony. It’s ideal for moderate realtime needs, but messages pass through Symfony, the payload is not blind in this mode.
Realtime-Core (Broker-first) is designed for high-scale use, with a stateless Python gateway and Redis/RabbitMQ streaming. Symfony acts as a producer and consumer. In this mode, the payload is blind in the gateway by design, enabling true end-to-end encryption. Unlike solutions such as Swoole, the gateway never sees plaintext. The architecture is horizontally scalable, polyglot-friendly, and future-proof.

The result is true bidirectional WebSockets, scalable connections, full Symfony integration, and complete control over your data - all fully self-hosted, without relying on SaaS.

What you guys think, thought this could be something reusable or did I miss something?

https://redd.it/1ra1tap
@r_php
I got tired of undocumented 3rd-party API changes breaking my apps, so I built Sentinel to passively detect JSON schema drift.

Hey everyone,

If you consume external REST APIs long enough, you know the pain: the provider silently drops a field, changes a string to an integer, or makes a previously required field optional. You usually only find out when your production app throws a null pointer exception or your DB rejects a type.

I built PHP Sentinel to solve this. It's a passive API contract monitor for PHP 8.3+ that sits in your HTTP client layer and watches the JSON coming back from the APIs you consume.

What it actually does: You don't write any schemas or rules by hand. Sentinel just silently observes the traffic.

1. Sampling: It watches the first X successful JSON responses for an endpoint.
2. Inference: It builds a probabilistically accurate JSON Schema (e.g., figuring out which fields are truly required vs which ones are just optional and happen to be missing sometimes).
3. Hardening: Once it hits the sample threshold (default 20), it locks the baseline schema.
4. Drift Detection: From then on, every new response is compared to the baseline in real-time. If the structure "drifts" (like a new field appears, or a required type changes), it dispatches an event and logs it.

Core features:

Zero-touch: Drop it into your PSR-18 client, Laravel `Http::` facade, or Symfony client and forget about it.
Smart Drift Rules: It knows that an optional field missing isn't drift, but a previously required field disappearing is a BREAKING change. A new undocumented field is just ADDITIVE.
Auto-healing: You can configure it to automatically "reharden" and build a new baseline after it reports a drift, so it adapts to legitimate API evolutions without you touching the code.
Framework Native: Comes with a Laravel ServiceProvider and a Symfony Bundle out of the box, plus an artisan/console CLI tool to inspect the inferred schemas manually.

Why I made it: Writing and maintaining OpenAPI specs for other people's APIs sucks. This is meant to be a passive safety net that gives you a Slack/log alert when a payload change happens, rather than digging through stack traces later.

It's fully unit-tested (Pest) and strictly typed (PHPStan Level 8).

Repo: https://github.com/malikad778/php-sentinel

I just pushed v1.0.3 and I'd love to hear what the community thinks. Are there specific edge cases in third-party API drift that you've been burned by? Any feedback on the architecture or inference engine would be awesome.

Thanks!

https://redd.it/1r9ze4l
@r_php
Why are so many packages designed exclusively for Laravel?

I have noticed that many packages that are being shared here lately are designed exclusively for Laravel. I know it is one of the largest (if not THE largest) framework for PHP, but does that mean that everyone should develop exclusively for it?

In my opinion every developer should look at the whole ecosystem around PHP and not just target one specific framework. IMO a framework agnostic package would be better as more people would benefit from it.

I don't want to link to any individual packages here because I don't want to blame the package maintainers. They have great ideas with their packages.

Of course, I don't have a solution for this. But I want to know if I am the only one who thinks this situation is going in the wrong direction or if my assumption is just plain wrong?

https://redd.it/1r8v229
@r_php
This media is not supported in your browser
VIEW IN TELEGRAM
I built this Laravel playground that runs completely in your browser (with no backend)

https://redd.it/1r8ezbx
@r_php
AuditTrailBundle v2 Released

Hi,

Thank you for your support and for showing interest in this project — I truly appreciate it.

I’ve put effort into improving the project by fixing code quality issues, strengthening security, and making it faster and more reliable.

Please note that this new version includes breaking changes, and I encourage you to upgrade to the latest version to benefit from these improvements.

You can review the changelog and benchmark results for more details.


cheers

https://redd.it/1rbeack
@r_php
Does anyone know any alternative for Laravel vscode extension? (A set of extensions is also fine)
https://redd.it/1rgxjsl
@r_php
Recommend please resources where I can learn internal PHP stuff

Recommend please resources where I can learn internal PHP stuff. l mean resources where I can learn how PHP works inside, it's internal mechanism and etc

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