[RFC] Four Pragmatic Directions for PHP: Simplicity, Arrays, Performance, Concurrency
| From: | 沉默领域、 | Date: | Tue, 24 Mar 2026 10:08:41 +0000 |
| Subject: | [RFC] Four Pragmatic Directions for PHP: Simplicity, Arrays, Performance, Concurrency | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-130424@lists.php.net to get a copy of this message | ||
Hi internals,
I'm a developer who uses both Java and PHP regularly. I'm writing
because I care about PHP's future.
PHP's strength has always been simplicity and pragmatism. But since
PHP 7 and especially PHP 8, we've been adding "enterprise features"
(typed properties, attributes, property hooks) that make PHP more like
Java – without achieving Java's type safety or ecosystem.
I believe PHP should refocus on what made it great. Here are four
pragmatic directions:
---
1. Stop Chasing Java
Every "enterprise feature" pushes developers like me toward Java. Not
because Java is better, but because if I need enterprise complexity
anyway, I'd rather use a language designed for it.
PHP cannot beat Java at its own game. But it can beat Java where it
matters: rapid prototyping, simple deployment, web-native development,
low learning curve.
Please keep PHP simple. Keep it pragmatic.
---
2. Add Practical Array Helpers
PHP is a web language – 90% of what we do is manipulate arrays. Yet
basic operations are still verbose:
```php
// Current
$names = array_values(array_filter($users, fn($u) => $u->active));
$first = count($names) > 0 ? $names[0] : null;
// Proposed
$names = array_pluck($users, 'name');
$names = array_where($users, fn($u) => $u->active);
$first = array_first($users);
$grouped = array_group_by($users, 'role');
$compact = array_compact($data);
These helpers would make everyday code cleaner without adding
complexity.
Improve Performance
Performance has always been a strength. Keep optimizing:
JIT for real-world web workloads
Reduce memory allocation in array operations
Make OpCache smarter
Provide Built-in Concurrency (Without Complexity)
Concurrency is the biggest missing piece. But instead of complex
async/await or coroutines, consider a simple worker management API:
php
$server = new WorkerServer(); $server->onWorkerStart(fn() => loadApp());
$server->onRequest(fn($req) => handle($req)); $server->start(4);
This would:
Run standalone: php server.php – no nginx, no PHP-FPM
Keep process isolation (each worker is separate)
Allow resource initialization once per worker
Give developers control without new concepts
Why not just use FrankenPHP? FrankenPHP is excellent, but requires an
additional binary and new deployment workflow. Many developers just
want a simple, built-in way to run their app without configuring two
services.
Why This Matters
PHP's competitors are winning on concurrency (Node.js, Go) and syntax
(Python). PHP's advantages – simplicity, web-native deployment, low
learning curve – are being eroded.
I don't want to leave PHP. I want PHP to stay great. I want to keep
choosing PHP for years to come.
Thank you for your time and for maintaining PHP. I'm happy to provide
more examples or participate in discussions.
Best regards,
[qinhao]