If you like to have music to focus while coding check this out
https://www.reddit.com/r/itsachillaccount/comments/1sej91h/coding_playlists_for_my_learning_journey/oeqbqep/
https://redd.it/1sptrxr
@r_php
https://www.reddit.com/r/itsachillaccount/comments/1sej91h/coding_playlists_for_my_learning_journey/oeqbqep/
https://redd.it/1sptrxr
@r_php
Reddit
itsachillaccount's comment on "Coding playlists for my learning journey"
Explore this conversation and more from the itsachillaccount community
When your first learn php what confuse the most ?
coming from go (I love golang) but I wanna do a little bit of freelancing so im doing some leetcode to understand php so I can learn lavarel and im not gonna lie im confuse by $ for local variable and params function (params function is variable underneath so it make sense ) and the array_push(references, ...values) and you what surprise or confuse you when you first learn php ? just started but php seems a little bit more complex than go am I wrong ?
https://redd.it/1spvhzm
@r_php
coming from go (I love golang) but I wanna do a little bit of freelancing so im doing some leetcode to understand php so I can learn lavarel and im not gonna lie im confuse by $ for local variable and params function (params function is variable underneath so it make sense ) and the array_push(references, ...values) and you what surprise or confuse you when you first learn php ? just started but php seems a little bit more complex than go am I wrong ?
https://redd.it/1spvhzm
@r_php
Reddit
From the PHP community on Reddit
Explore this post and more from the PHP community
Planning to get back into writing Laravel content and would love some feedback on my direction
I've been building with Laravel for a while now and somewhere along the way I stopped writing about it. Life, client work, you know how it goes.
But I've decided to get back into it properly. I'm refreshing my site and starting to put out content that's actually useful for the Laravel community rather than just generic tutorial stuff that already exists everywhere.
My focus is going to be on:
1. Real world implementation patterns not just hello world examples.
2. Laravel with modern tooling like Livewire, Filament, and Inertia.
3. AI integration in Laravel apps which is something I've been doing a lot of lately.
4. Performance and architecture decisions for production apps.
I want it to feel less like a documentation mirror and more like something written by someone who's actually shipped Laravel apps and hit the real problems.
If anyone's curious the site is larashout.com, it's a bit bare right now but that's kind of the point of this post. I'm rebuilding it with intention this time.
My question for the community is what are you actually struggling with in Laravel right now that you can't find a solid answer for? What would you actually want to read?
I'd rather write ten posts that genuinely help people than a hundred that nobody bookmarks.
https://redd.it/1spt4l5
@r_php
I've been building with Laravel for a while now and somewhere along the way I stopped writing about it. Life, client work, you know how it goes.
But I've decided to get back into it properly. I'm refreshing my site and starting to put out content that's actually useful for the Laravel community rather than just generic tutorial stuff that already exists everywhere.
My focus is going to be on:
1. Real world implementation patterns not just hello world examples.
2. Laravel with modern tooling like Livewire, Filament, and Inertia.
3. AI integration in Laravel apps which is something I've been doing a lot of lately.
4. Performance and architecture decisions for production apps.
I want it to feel less like a documentation mirror and more like something written by someone who's actually shipped Laravel apps and hit the real problems.
If anyone's curious the site is larashout.com, it's a bit bare right now but that's kind of the point of this post. I'm rebuilding it with intention this time.
My question for the community is what are you actually struggling with in Laravel right now that you can't find a solid answer for? What would you actually want to read?
I'd rather write ten posts that genuinely help people than a hundred that nobody bookmarks.
https://redd.it/1spt4l5
@r_php
Larashout
Larashout | Practical Laravel, PHP, JavaScript, and web development tutorials
Practical Laravel, PHP, JavaScript, and web development tutorials with searchable guides, categories, and static publishing.
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/1sqgs0t
@r_php
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/1sqgs0t
@r_php
Reddit
From the PHP community on Reddit
Explore this post and more from the PHP community
I spent my senior year building a pure-PHP async ecosystem for PHP 8.4. Meet HiblaPHP
I'm a final-year IT student in the Philippines. Between classes, I spent months building a complete async I/O ecosystem for PHP from scratch. Today I'm releasing it as Public Beta and I'd love your brutal feedback.
It's called Hibla a Tagalog for "Fiber."
### Why I Built This
PHP was the first programming language I ever learned and loved. And for a long time, like a lot of PHP developers, I thought async was something that happened elsewhere in Node.js, in Go, in "serious" backend languages.
Then I found ReactPHP. It cracked something open in my brain. I realized async wasn't a language feature, it was an idea, and PHP was capable of it. I got obsessed. I wanted to understand it from the ground up, not just use a library, but build one so I'd truly know how it worked.
Hibla is what came out of that obsession. It started as a learning project. It turned into something I think is actually useful.
### What's in the Ecosystem
- Event Loop: Dual-driver (
- MySQL Driver: Pure-PHP binary protocol with side-channel
- HTTP Client: Async by default, full SSE support, and with full Http Mocking Simulator.
- Parallel: Erlang-style supervised worker pools that detect segfaults and OOMs and automatically respawn replacements
- Structured Concurrency: A strict 4-state Promise model that makes cleanup deterministic and safe
### The Core Idea: Fractal Concurrency
The design goal I'm most proud of: because every worker is "smart" and runs its own event loop, you can compose units of concurrency recursively. Parallel processes, async fibers, and raw I/O all interleave inside a single
### Performance
To stress-test the foundation, I built a raw TCP responder using
### Standing on Giants
Hibla wouldn't exist without ReactPHP, whose work taught me how async PHP actually functions, and AmPHP, whose pioneering RFC work brought native Fibers to the PHP engine. I'm genuinely in their debt.
### Honest Caveats
- No dedicated docs site yet. Every package has a thorough README covering lifecycle events, trade-offs, and examples. It's not pretty, but it's complete.
- This is a Public Beta. I expect rough edges. That's exactly why I'm here.
I'm a student who built this with everything I had and honestly, I'm nervous hitting post on this. But I'd love your sharpest technical critiques: architecture, API design, edge cases I missed, anything. Don't hold back.
Here's the link to the main repository..
-> github.com/hiblaphp
https://redd.it/1sqifb0
@r_php
I'm a final-year IT student in the Philippines. Between classes, I spent months building a complete async I/O ecosystem for PHP from scratch. Today I'm releasing it as Public Beta and I'd love your brutal feedback.
It's called Hibla a Tagalog for "Fiber."
### Why I Built This
PHP was the first programming language I ever learned and loved. And for a long time, like a lot of PHP developers, I thought async was something that happened elsewhere in Node.js, in Go, in "serious" backend languages.
Then I found ReactPHP. It cracked something open in my brain. I realized async wasn't a language feature, it was an idea, and PHP was capable of it. I got obsessed. I wanted to understand it from the ground up, not just use a library, but build one so I'd truly know how it worked.
Hibla is what came out of that obsession. It started as a learning project. It turned into something I think is actually useful.
### What's in the Ecosystem
- Event Loop: Dual-driver (
stream_select + libuv), with Node.js-style execution phases- MySQL Driver: Pure-PHP binary protocol with side-channel
KILL QUERY cancellation and deterministic LRU statement caching. No orphaned queries.- HTTP Client: Async by default, full SSE support, and with full Http Mocking Simulator.
- Parallel: Erlang-style supervised worker pools that detect segfaults and OOMs and automatically respawn replacements
- Structured Concurrency: A strict 4-state Promise model that makes cleanup deterministic and safe
### The Core Idea: Fractal Concurrency
The design goal I'm most proud of: because every worker is "smart" and runs its own event loop, you can compose units of concurrency recursively. Parallel processes, async fibers, and raw I/O all interleave inside a single
Promise::all() seamlessly.$results = await(Promise::all([
$pool->run(fn() => cpu_heavy_work()), // Supervised pool task
parallel(fn() => sleep(1)), // One-off parallel process
async(function() { // Native Fiber, no spawn
$user = await(Http::get("https://api.example.com/user/1"));
return $user->json();
}),
parallel(function() { // "Hybrid" worker with its own Fibers
await(Promise::all([
async(fn() => await(delay(1))),
async(fn() => await(delay(1))),
]));
echo "Hybrid Done";
})
]));
// The entire block above completes in ~1 second
### Performance
To stress-test the foundation, I built a raw TCP responder using
SO_REUSEPORT across the worker pool. It hit 116,000+ RPS on 4 cores. A real HTTP server will be slower, but this proves the core has virtually zero overhead.### Standing on Giants
Hibla wouldn't exist without ReactPHP, whose work taught me how async PHP actually functions, and AmPHP, whose pioneering RFC work brought native Fibers to the PHP engine. I'm genuinely in their debt.
### Honest Caveats
- No dedicated docs site yet. Every package has a thorough README covering lifecycle events, trade-offs, and examples. It's not pretty, but it's complete.
- This is a Public Beta. I expect rough edges. That's exactly why I'm here.
I'm a student who built this with everything I had and honestly, I'm nervous hitting post on this. But I'd love your sharpest technical critiques: architecture, API design, edge cases I missed, anything. Don't hold back.
Here's the link to the main repository..
-> github.com/hiblaphp
https://redd.it/1sqifb0
@r_php
GitHub
GitHub - hiblaphp/hibla: Modern Asynchonous Runtime for PHP
Modern Asynchonous Runtime for PHP. Contribute to hiblaphp/hibla development by creating an account on GitHub.
Lerd, a local dev environment that works great with Symfony on Linux and macOS
https://geodro.github.io/lerd
https://redd.it/1sqinz5
@r_php
https://geodro.github.io/lerd
https://redd.it/1sqinz5
@r_php
Lerd
Lerd - Local PHP development for Linux
Open-source local PHP development environment for Linux. Automatic .test domains, PHP 8.1–8.5, rootless Podman, built-in Web UI. Works on Ubuntu, Fedora, Arch, and Debian.
Vulnerability checks in packages
I was wondering how do you check for security issues within used packages/libraries. I use composer and I have a server script that runs daily 'composer audit' command and sends the results (if any), but I guess that depends on the author(s) of the package.
Any better approach?
https://redd.it/1sqkg7d
@r_php
I was wondering how do you check for security issues within used packages/libraries. I use composer and I have a server script that runs daily 'composer audit' command and sends the results (if any), but I guess that depends on the author(s) of the package.
Any better approach?
https://redd.it/1sqkg7d
@r_php
Reddit
From the PHP community on Reddit
Explore this post and more from the PHP community
Building a PHP runtime in Rust — what am I missing?
Hey folks,
I've been hacking on a PHP runtime written in Rust for a while now and I think I hit the point where I need outside opinions before I keep going. Not trying to sell anything here, just want honest feedback from people who actually put PHP in production.
Here's roughly what it does today:
Config / deployment stuff
one TOML file for everything (listener, TLS, workers, limits, logging)
virtual hosts
hot reload without dropping connections
Docker images for PHP 8.3 / 8.4 / 8.5, both NTS and ZTS
can build a single static binary with the app embedded
Execution modes
classic request/response (works like FPM)
persistent mode, where the app boots once and serves many requests
proper worker lifecycle hooks (boot / request / shutdown / reload)
Concurrency bits
shared table and atomic counters for cross-request state
task queue for background jobs
async I/O (parallel HTTP, non-blocking file stuff)
native WebSocket server, no sidecar process
HTTP / perf
HTTP/1.1 and HTTP/2 (HTTP/3 is on the roadmap, not done yet)
TLS with auto-cert or bring your own
gzip / br / zstd compression
early hints (103)
X-Sendfile
CORS out of the box
opcache shared across workers
Security
rate limiting
request size / header limits
IP allow/deny
CSRF helpers and sensible security header defaults
TLS hardening presets
Observability
Prometheus `/metrics` (requests, latency histograms, worker state, memory per worker)
health checks
structured JSON logs by default
a built-in dashboard showing live workers and requests
Compatibility
Laravel, Symfony and WordPress run unmodified
treating FPM feature parity as a release blocker, not a "someday"
Rust + tokio under the hood, PHP code doesn't change
core stays minimal, extras are opt-in
full features: https://github.com/turbine-php/turbine
Things I'd actually love input on:
1. Is a single-file config a win, or do your ops people hate that?
2. Which FPM features do new runtimes always forget and then bite you later?
3. What metrics do you actually stare at when something's on fire at 3 AM?
4. What extension combos would you want in a pre-built image?
5. What obvious thing am I missing from the list?
Happy to go deeper on any of these if anyone's curious.
https://redd.it/1sqiem1
@r_php
Hey folks,
I've been hacking on a PHP runtime written in Rust for a while now and I think I hit the point where I need outside opinions before I keep going. Not trying to sell anything here, just want honest feedback from people who actually put PHP in production.
Here's roughly what it does today:
Config / deployment stuff
one TOML file for everything (listener, TLS, workers, limits, logging)
virtual hosts
hot reload without dropping connections
Docker images for PHP 8.3 / 8.4 / 8.5, both NTS and ZTS
can build a single static binary with the app embedded
Execution modes
classic request/response (works like FPM)
persistent mode, where the app boots once and serves many requests
proper worker lifecycle hooks (boot / request / shutdown / reload)
Concurrency bits
shared table and atomic counters for cross-request state
task queue for background jobs
async I/O (parallel HTTP, non-blocking file stuff)
native WebSocket server, no sidecar process
HTTP / perf
HTTP/1.1 and HTTP/2 (HTTP/3 is on the roadmap, not done yet)
TLS with auto-cert or bring your own
gzip / br / zstd compression
early hints (103)
X-Sendfile
CORS out of the box
opcache shared across workers
Security
rate limiting
request size / header limits
IP allow/deny
CSRF helpers and sensible security header defaults
TLS hardening presets
Observability
Prometheus `/metrics` (requests, latency histograms, worker state, memory per worker)
health checks
structured JSON logs by default
a built-in dashboard showing live workers and requests
Compatibility
Laravel, Symfony and WordPress run unmodified
treating FPM feature parity as a release blocker, not a "someday"
Rust + tokio under the hood, PHP code doesn't change
core stays minimal, extras are opt-in
full features: https://github.com/turbine-php/turbine
Things I'd actually love input on:
1. Is a single-file config a win, or do your ops people hate that?
2. Which FPM features do new runtimes always forget and then bite you later?
3. What metrics do you actually stare at when something's on fire at 3 AM?
4. What extension combos would you want in a pre-built image?
5. What obvious thing am I missing from the list?
Happy to go deeper on any of these if anyone's curious.
https://redd.it/1sqiem1
@r_php
GitHub
GitHub - turbine-php/turbine: High-performance PHP application server written in Rust, powered by the PHP embed SAPI
High-performance PHP application server written in Rust, powered by the PHP embed SAPI - turbine-php/turbine
Killed By Laravel - A clone of killedbygoogle.com for the Laravel ecosystem
https://killed-by-laravel.harkema.dev/
https://redd.it/1sqpx2c
@r_php
https://killed-by-laravel.harkema.dev/
https://redd.it/1sqpx2c
@r_php
Killed by Laravel
Killed by Laravel is the open source list of dead Laravel products, services, and devices. It serves as a tribute and memorial of beloved services and products killed by Laravel.
Lumen (API-only in Laravel) replacement?
I want to build a purely API in Laravel and Nissan Lumen. Is there anything comparable?
Since there will never be a front-end to this pulling in the whole framework is overkill.
https://redd.it/1sqri0f
@r_php
I want to build a purely API in Laravel and Nissan Lumen. Is there anything comparable?
Since there will never be a front-end to this pulling in the whole framework is overkill.
https://redd.it/1sqri0f
@r_php
Reddit
From the laravel community on Reddit
Explore this post and more from the laravel community
SymfonyDay Montreal 2026 - Schedule is Live!
https://symfony.com/blog/symfonyday-montreal-2026-schedule-is-live?utm_medium=feed&utm_source=Symfony%20Blog%20Feed
https://redd.it/1sqwtyf
@r_php
https://symfony.com/blog/symfonyday-montreal-2026-schedule-is-live?utm_medium=feed&utm_source=Symfony%20Blog%20Feed
https://redd.it/1sqwtyf
@r_php
Symfony
SymfonyDay Montreal 2026 - Schedule is Live! (Symfony Blog)
Montreal, are you ready? SymfonyDay 2026 schedule has landed! 8 expert speakers, 1 iconic venue, and a community apéro to top it all off!
Live Walkthrough: What's new in Laravel Starter Kits w/ Wendell Adriel
The Laravel starter kits (React, Vue, Svelte, and Livewire) have had a huge run of updates recently, including team support, Inertia v3 support, and toast notifications.
I'll be going live tomorrow (04/21) at 12pm EDT (4pm UTC) with Wendell Adriel for a walkthrough of what's new. We'll also touch on Maestro, the orchestrator that powers how all the kits stay in sync.
Would love to see you there! If you have any questions, feel free to drop them here ahead of time or ask in chat during the stream!
Stream: https://www.youtube.com/watch?v=AbPSAt46Ja0
https://redd.it/1sr5s1e
@r_php
The Laravel starter kits (React, Vue, Svelte, and Livewire) have had a huge run of updates recently, including team support, Inertia v3 support, and toast notifications.
I'll be going live tomorrow (04/21) at 12pm EDT (4pm UTC) with Wendell Adriel for a walkthrough of what's new. We'll also touch on Maestro, the orchestrator that powers how all the kits stay in sync.
Would love to see you there! If you have any questions, feel free to drop them here ahead of time or ask in chat during the stream!
Stream: https://www.youtube.com/watch?v=AbPSAt46Ja0
https://redd.it/1sr5s1e
@r_php
YouTube
Laravel Starter Kits: What's New w/ Wendell Adriel
Laravel's starter kits give you a head start on your next application with authentication, settings, and best practices built in across React, Vue, Svelte, and Livewire. They just received a huge run of updates, including team support, Inertia v3 support…
Smart Cache Invalidation - Laravel In Practice EP10
https://youtu.be/-MChE-igkQE
https://redd.it/1srfwgl
@r_php
https://youtu.be/-MChE-igkQE
https://redd.it/1srfwgl
@r_php
YouTube
Cache Smart Invalidation - Laravel In Practice EP10
In this episode, Harris from Laravel News shows you exactly how to:
- Address stale data issues in your cache
- Implement smart invalidation for your Laravel caching system
- Clear cache keys efficiently when orders change
- Adjust and align cache keys for…
- Address stale data issues in your cache
- Implement smart invalidation for your Laravel caching system
- Clear cache keys efficiently when orders change
- Adjust and align cache keys for…
🎬 SymfonyLive Paris 2026 : les replays sont en ligne !
https://symfony.com/blog/symfonylive-paris-2026-les-replays-sont-en-ligne?utm_medium=feed&utm_source=Symfony%20Blog%20Feed
https://redd.it/1srldvs
@r_php
https://symfony.com/blog/symfonylive-paris-2026-les-replays-sont-en-ligne?utm_medium=feed&utm_source=Symfony%20Blog%20Feed
https://redd.it/1srldvs
@r_php
Symfony
🎬 SymfonyLive Paris 2026 : les replays sont en ligne ! (Symfony Blog)
Les replays de SymfonyLive Paris 2026 sont en ligne ! Revivez les conférences, découvrez un talk gratuit de Fabien Potencier et replongez dans l’événement avec la vidéo récap.
Writing Your Own Framework in PHP: Part One
https://chrastecky.dev/programming/writing-your-own-framework-in-php-part-one
https://redd.it/1srnxvc
@r_php
https://chrastecky.dev/programming/writing-your-own-framework-in-php-part-one
https://redd.it/1srnxvc
@r_php
chrastecky.dev
Writing Your Own Framework in PHP: Part One | Blog by Dominik Chrástecký
A hands-on intro to building your own PHP framework entirely from scratch — handwritten, with minimal dependencies.
Splitting Laravel Boost guidelines across multiple files
https://laracraft.tech/blog/splitting-laravel-boost-guidelines-across-multiple-files
https://redd.it/1sryize
@r_php
https://laracraft.tech/blog/splitting-laravel-boost-guidelines-across-multiple-files
https://redd.it/1sryize
@r_php
Laracraft
Splitting Laravel Boost guidelines across multiple files
Laravel Boost only reads a single core.blade.php per package, so extra sibling files get silently dropped. Here is the minimal pattern for splitting your guidelines into organized partials using a Blade view namespace.
What does your PHP stack actually look like in 2026?
I've been building PHP applications professionally for 10+ years, and I'm curious what everyone here is using these days.
Our current stack at work:
* PHP 8.3 + Laravel
* Vue.js on the frontend
* MySQL + Redis for caching
* Docker for local dev and deployments
* GitHub Actions for CI/CD
* AWS for hosting
We've tried moving parts to Node.js a couple of times, but honestly, keep coming back to Laravel for anything business-critical. The ecosystem is just too mature and productive to give up.
A few things I've noticed in 2026:
* PHP 8.3 JIT is genuinely fast now, the performance gap with Node is much smaller than people think
* GraphQL adoption in PHP projects has grown a lot
* Redis has basically become a default part of every stack
Curious what others are doing, are you still on Laravel or have you moved to Symfony, Slim, or something else entirely? Anyone running PHP in a microservices setup with Docker and Kubernetes?
Drop your stack below. 👇
https://redd.it/1ssct11
@r_php
I've been building PHP applications professionally for 10+ years, and I'm curious what everyone here is using these days.
Our current stack at work:
* PHP 8.3 + Laravel
* Vue.js on the frontend
* MySQL + Redis for caching
* Docker for local dev and deployments
* GitHub Actions for CI/CD
* AWS for hosting
We've tried moving parts to Node.js a couple of times, but honestly, keep coming back to Laravel for anything business-critical. The ecosystem is just too mature and productive to give up.
A few things I've noticed in 2026:
* PHP 8.3 JIT is genuinely fast now, the performance gap with Node is much smaller than people think
* GraphQL adoption in PHP projects has grown a lot
* Redis has basically become a default part of every stack
Curious what others are doing, are you still on Laravel or have you moved to Symfony, Slim, or something else entirely? Anyone running PHP in a microservices setup with Docker and Kubernetes?
Drop your stack below. 👇
https://redd.it/1ssct11
@r_php
Reddit
From the PHP community on Reddit
Explore this post and more from the PHP community
Guest Post: Why We Chose NativePHP Over Flutter for Bagisto's Mobile Admin
https://nativephp.com/blog/nativephp-not-flutter-for-bagisto-mobile-admin-app
https://redd.it/1ssflmx
@r_php
https://nativephp.com/blog/nativephp-not-flutter-for-bagisto-mobile-admin-app
https://redd.it/1ssflmx
@r_php
Nativephp
Why We Chose NativePHP Over Flutter for Bagisto's Mobile Admin
One weekend was all it took
The latest and greatest in postcardware at Spatie
https://spatie.be/blog/the-latest-and-greatest-in-postcardware-at-spatie
https://redd.it/1ssgdwu
@r_php
https://spatie.be/blog/the-latest-and-greatest-in-postcardware-at-spatie
https://redd.it/1ssgdwu
@r_php
spatie.be
The latest and greatest in postcardware at Spatie
Earlier this year at Spatie, we spend a full day hacking away on fun sideprojects during our hackathon. The goal was to create something fun and functional by the end of the day.
We (Nick and Dries) decided to create a digital version of our postcard wall.…
We (Nick and Dries) decided to create a digital version of our postcard wall.…
I tested every PHP parallel library on Windows. Only one actually worked without making me want to quit.
Background: I'm a PHP dev primarily on Windows and I needed real parallelism and just async, actual CPU-bound tasks running in separate processes simultaneously for my csv parser that process billions of items using cross platform pure PHP solution.
Here's what I found going through the options:
**spatie/async** : nope. Depends on `pcntl` which doesn't exist on Windows. It silently falls back to running everything synchronously. No warning, no error. Just... slow.
**nunomaduro/pokio** : this one looked promising. Nuno Maduro (the guy behind Pest, Pint, Laravel Zero) released it recently with a really clean API:
```php
$promiseA = async(fn() => heavyWork());
$promiseB = async(fn() => otherWork());
[$a, $b] = await([$promiseA, $promiseB]);
```
Looks great. But under the hood it uses PCNTL to fork and FFI for shared memory IPC. On Windows, neither exists. The docs say it "automatically falls back to sequential execution" and which sounds polite but means it silently stops being parallel entirely. Same problem as spatie/async, just with a nicer API.
**ext-parallel** : nope need external extension, and wont even work on windows and need ZTS build.
**pcntl_fork() directly** : Unix only and too complex. Not even worth trying.
**amphp/parallel** : technically works on Windows, but the DX is painful. To run anything in parallel you have to define a dedicated Task class, implement a `run()` method, make sure it's autoloadable in the worker, serialize your inputs manually, and wire up a worker pool on top. Just to run a task in another process and it has high cognitive load:
```php
class MyTask implements Task {
public function __construct(private readonly string $url) {}
public function run(Channel $channel, Cancellation $cancellation): string {
return file_get_contents($this->url);
}
}
// in a separate script
$worker = Amp\Parallel\Worker\createWorker();
$execution = $worker->submit(new MyTask('https://example.com'));
$result = $execution->await();
```
That's a lot of ceremony. And `echo` inside workers isn't reliable and the Amp docs explicitly say ordering is not guaranteed and it's "not recommended."
**Laravel Concurrency facade** — this one is actually clean and works on Windows:
```php
[$users, $posts] = Concurrency::run([
fn() => DB::table('users')->get(),
fn() => DB::table('posts')->get(),
]);
```
But there are two big problems. First, the name is misleading plus it's not actually concurrency in the traditional sense. Under the hood it's just spawning separate PHP processes via `artisan`, which is parallelism, not shared-memory concurrency. Second and more importantly: to use it you have to pull in the **entire Fat Laravel framework**. All of it. Just to run closures in parallel. If you're already in a Laravel project it's a decent option, but using it standalone purely for parallelism means booting a full framework on every worker spawn. The overhead is real and the dependency is enormous for what it actually does. Also, using print statement inside parallel task crash its json based ipc.
Then I found **hiblaphp/parallel**, released literally days ago. The author specifically handled Windows by switching to socket pairs for IPC instead of anonymous pipes (which don't support non-blocking mode on Windows). and it has great serialization
I was skeptical so I benchmarked it:
```
100 runs, persistent pool of 10 with booted workers on Windows:
Median: 0.583ms per task
Avg: 0.839ms per task
P95: 1.036ms
```
Sub-millisecond. On Windows. I did not expect that.
The API couldn't be more different from Amp's:
```php
echo "Main PID " . getmypid() . PHP_EOL;
$result = await(
parallel(function () {
sleep(1);
$pid = getmypid();
echo "PID: " . getmypid(). PHP_EOL;
return $pid
})
);
$pool = Parallel::pool(size: 4)->boot();
$result = await($pool->run(fn() => $processItem($data)));
$pool->shutdown();
Parallel::task()
Background: I'm a PHP dev primarily on Windows and I needed real parallelism and just async, actual CPU-bound tasks running in separate processes simultaneously for my csv parser that process billions of items using cross platform pure PHP solution.
Here's what I found going through the options:
**spatie/async** : nope. Depends on `pcntl` which doesn't exist on Windows. It silently falls back to running everything synchronously. No warning, no error. Just... slow.
**nunomaduro/pokio** : this one looked promising. Nuno Maduro (the guy behind Pest, Pint, Laravel Zero) released it recently with a really clean API:
```php
$promiseA = async(fn() => heavyWork());
$promiseB = async(fn() => otherWork());
[$a, $b] = await([$promiseA, $promiseB]);
```
Looks great. But under the hood it uses PCNTL to fork and FFI for shared memory IPC. On Windows, neither exists. The docs say it "automatically falls back to sequential execution" and which sounds polite but means it silently stops being parallel entirely. Same problem as spatie/async, just with a nicer API.
**ext-parallel** : nope need external extension, and wont even work on windows and need ZTS build.
**pcntl_fork() directly** : Unix only and too complex. Not even worth trying.
**amphp/parallel** : technically works on Windows, but the DX is painful. To run anything in parallel you have to define a dedicated Task class, implement a `run()` method, make sure it's autoloadable in the worker, serialize your inputs manually, and wire up a worker pool on top. Just to run a task in another process and it has high cognitive load:
```php
class MyTask implements Task {
public function __construct(private readonly string $url) {}
public function run(Channel $channel, Cancellation $cancellation): string {
return file_get_contents($this->url);
}
}
// in a separate script
$worker = Amp\Parallel\Worker\createWorker();
$execution = $worker->submit(new MyTask('https://example.com'));
$result = $execution->await();
```
That's a lot of ceremony. And `echo` inside workers isn't reliable and the Amp docs explicitly say ordering is not guaranteed and it's "not recommended."
**Laravel Concurrency facade** — this one is actually clean and works on Windows:
```php
[$users, $posts] = Concurrency::run([
fn() => DB::table('users')->get(),
fn() => DB::table('posts')->get(),
]);
```
But there are two big problems. First, the name is misleading plus it's not actually concurrency in the traditional sense. Under the hood it's just spawning separate PHP processes via `artisan`, which is parallelism, not shared-memory concurrency. Second and more importantly: to use it you have to pull in the **entire Fat Laravel framework**. All of it. Just to run closures in parallel. If you're already in a Laravel project it's a decent option, but using it standalone purely for parallelism means booting a full framework on every worker spawn. The overhead is real and the dependency is enormous for what it actually does. Also, using print statement inside parallel task crash its json based ipc.
Then I found **hiblaphp/parallel**, released literally days ago. The author specifically handled Windows by switching to socket pairs for IPC instead of anonymous pipes (which don't support non-blocking mode on Windows). and it has great serialization
I was skeptical so I benchmarked it:
```
100 runs, persistent pool of 10 with booted workers on Windows:
Median: 0.583ms per task
Avg: 0.839ms per task
P95: 1.036ms
```
Sub-millisecond. On Windows. I did not expect that.
The API couldn't be more different from Amp's:
```php
echo "Main PID " . getmypid() . PHP_EOL;
$result = await(
parallel(function () {
sleep(1);
$pid = getmypid();
echo "PID: " . getmypid(). PHP_EOL;
return $pid
})
);
$pool = Parallel::pool(size: 4)->boot();
$result = await($pool->run(fn() => $processItem($data)));
$pool->shutdown();
Parallel::task()