PHP Reddit – Telegram
PHP Reddit
34 subscribers
289 photos
37 videos
24.8K links
Channel to sync with /r/PHP /r/Laravel /r/Symfony. Powered by awesome @r_channels and @reddit2telegram
Download Telegram
"Codes of Conduct" have been a disaster

from <https://x.com/esrtweet/status/1971768345188844003>

> "Codes of Conduct" have been a disaster - a kind of infectious social insanity producing lots of drama and politics and backbiting, and negative useful work.
>
> Here is my advice about codes of conduct:
>
> 1. Refuse to have one. If your project has one, delete it. The only actual function they have is as a tool in the hands of sh!t-stirrers.
>
> 2. If you're stuck with having one for bureaucratic reasons, replace it with the following sentence or some close equivalent: "If you are more annoying to work with than your contributions justify, you'll be ejected."
>
> 3. Attempts to be more specific and elaborate don't work. They only provide control surfaces for shit-stirrers to manipulate.
>
> Yes, we should try to be kind to each other. But we should be ruthless and merciless towards people who try to turn "Be kind!" into a weapon. Indulging them never ends well.

https://redd.it/1nrw0ci
@r_php
Vibe coded your Symfony app? How about vibe-debugging (+symfony/ai integration)

Hey Symfony devs! 👋


I built VibedebugBundle, a small bundle that lets you send your app’s exceptions to AI agents for analysis without leaving Symfony Profiler.


Key features:

Automatically collects exceptions and generates a Markdown prompt with stack trace.
Send prompts to your AI agents defined with symfony/ai-agent-bundle.
View AI responses directly in the Profiler.
Export prompts as Markdown via the profiler token.

Perfect for quickly understanding errors and getting AI suggestions without copying code or manually writing prompts.

The bundle is inspired by this RFC


🌟 Explore and contribute! You can star, follow, and fork the project here: https://github.com/sonnymilton/vibedebug-bundle/

https://redd.it/1nslx3x
@r_php
I was just chilling and built a Go wrapper for Laravel queue worker that's 21x faster

So I was bored last weekend and got curious about why php artisan queue:work feels slow sometimes. Instead of doing something productive, I decided to mess around with Go (still learning go) and see if I could make it faster.

What I built:

Go program that manages multiple persistent PHP processes (sub workers spawned by go)
Each PHP process runs a custom Laravel command that accepts jobs via stdin
Go handles job distribution and coordination
Basically Go babysits PHP workers lol

The results were... unexpected:

1k jobs:

Normal Laravel worker: 14 seconds
My janky Go thing: 1.3 seconds

10k jobs:

Normal Laravel: 2+ minutes
Go with 6 PHP workers: 6.4 seconds

Some notes:

This is NOT production ready (missing error handling, proper shutdown, etc.)
I didn't measure CPU/memory usage so who knows if it's actually better resource wise
Definitely not trying to replace Laravel's queue system
Just a "what if" experiment that got out of hand
Communicate with two programming languages (PHP and GO) without barriers .
Maybe i did mistakes in code just correct me , I'm just learning go .

https://github.com/LAGGOUNE-Walid/laravel-queue-worker-in-go

Laravel implementation : https://github.com/illuminate/queue/blob/d4debc9e4e3545aca58b5ad50767340f80d25fc2/Worker.php

https://redd.it/1nsqxqh
@r_php
I was just chilling and built a Go wrapper for Laravel queue worker that's 21x faster

So I was bored last weekend and got curious about why php artisan queue:work feels slow sometimes. Instead of doing something productive, I decided to mess around with Go (still learning go) and see if I could make it faster.

What I built:

Go program that manages multiple persistent PHP processes (sub workers spawned by go)
Each PHP process runs a custom Laravel command that accepts jobs via stdin
Go handles job distribution and coordination
Basically Go babysits PHP workers lol

The results were... unexpected:

1k jobs:

Normal Laravel worker: 14 seconds
My janky Go thing: 1.3 seconds

10k jobs:

Normal Laravel: 2+ minutes
Go with 6 PHP workers: 6.4 seconds

Some notes:

This is NOT production ready (missing error handling, proper shutdown, etc.)
I didn't measure CPU/memory usage so who knows if it's actually better resource wise
Definitely not trying to replace Laravel's queue system
Just a "what if" experiment that got out of hand
Communicate with two programming languages (PHP and GO) without barriers .
Maybe i did mistakes in code just correct me , I'm just learning go .

REPO : https://github.com/LAGGOUNE-Walid/laravel-queue-worker-in-go

https://redd.it/1nsteuk
@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/1nsth3a
@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/1nt7i7r
@r_php
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!

https://redd.it/1ntad7n
@r_php
Commands and Jobs

Hi everyone,

Imagine the scenario:

User has a button that will perform a heavy lifting task. My approach ? Create a Job for this.

This task will also have a schedule command because needs to run everyday for each client that we have. Business logic for this task is on a service. Should i call on the command the service function or dispatch the job?

Thanks

https://redd.it/1ntp6ap
@r_php
A new PHP Job Board

# I launched a new PHP Job Board for high quality PHP Jobs. Recruiters and Developers do consider joining. First 100 verified recruiters get to post a job for free!

https://redd.it/1nu7yow
@r_php
Where can I find a collection of custom built PHP functions?

I know PHP alone has so many built-in functions, but I wonder if there are free custom built-in PHP functions for any web app to use.
When I do search on Google I have found only for WordPress.

Eg, in my web app the below code is used to truncate a long string and add ....
function cutString($cutString, $numberToCut){

if(mb_strlen($cutString, 'UTF-8') > $numberToCut){ // If the String has more than X characters then show ...

return mb_substr($cutString, 0, $numberToCut, 'UTF-8').'...';

}else{

return $cutString;

}

}

This has been used in whole web app as a string truncator in to what exactly I want from.

And here another custom built-in function from my web app:
function getDomain($url) {

$host = parse_url($url, PHP_URL_HOST);

if ($host) {

// length validation + expanded TLD patterns

preg_match('/([a-z0-9\-]{1,63}\.(?:[a-z]{2,63}|[a-z]{2}\.[a-z]{2}|[a-z]{3}\.[a-z]{2}))$/i', $host, $matches);

return $matches[1] ?? $host;

}else{

return null;

}

}

Is there a collection or repository of custom-built PHP functions for anyone to use?

Also, nowadays, are custom-built functions like the above still valuable to others? If I share mine on GitHub, would it help? Sometimes it feels like I'm one of the few developers still messing with custom PHP codes.

https://redd.it/1nuav7x
@r_php
Share Your Laravel Story: Be Featured as Artisan of the Day!
https://redd.it/1nuft56
@r_php