swoole-bundle/z-engine
Integrates Z-Engine with Swoole Bundle to deliver coroutine-based, high-performance PHP execution for Laravel and other PHP apps. Simplifies async runtime setup, worker configuration, and Swoole-powered request handling for scalable services.
time(), date(), random_bytes(), mt_rand(), and similar internals below your application code. That closes the gap left by Carbon::setTestNow() and PSR-20 clocks, which only work where code happens to call through your abstraction. Decision: fund a shared time-travel harness, or keep letting squads hand-roll it?sleep(), a static singleton), the choice is normally fork/patch/wrap/replace. Runtime interception adds a fourth option: keep the vendor package, patch behavior in the test or edge environment. That's a roadmap-relevant cost lever.symfony-swoole) signals intent around resident-memory runtimes; runtime patching without redeploy is a real, if risky, capability for hotfixing a single tenant's behavior in a worker pool.Consider it when all of these hold:
TimeProvider, Interceptor) so exactly one module touches the engine API.Look elsewhere when:
ClockMock, PSR-20 fakes. Cheaper, portable, no build step.Adoption gates (evidence, not vibes):
| Signal | Reading |
|---|---|
| 4 stars, 0 dependents | Effectively unproven. No public production reference to learn from. |
| Opportunity score (46.7) ≫ quality score (16.6) | The capability is more valuable than the artifact — supports a timeboxed spike, not a platform bet. |
| C-extension ABI coupling | Budget a rebuild per PHP minor release; treat PHP upgrades as a dependency migration. |
| Full function-table write access | Security review required: arbitrary behavior rewriting is a supply-chain and insider-risk surface. |
Recommended shape: a one-to-two sprint spike, test-only, one team, one use case (deterministic time), with a written exit plan. Kill it if the adapter can't hide 100% of the API.
To executives (one paragraph): This is a small, timeboxed experiment in making our test suites deterministic and reducing our dependence on forked vendor code. It is a low-cost option on a capability we currently pay for in engineer hours, not a platform commitment. The package itself is immature — negligible adoption, single-maintainer risk, and it requires a compiled PHP extension — so the ask is two engineer-weeks behind a feature boundary we can delete, with a go/no-go at the end. Expected payoff is faster, less flaky CI and avoided vendor forks; downside is capped at the spike cost.
To engineering: Treat it as a sharp tool, quarantined. One adapter interface, test/dev environments only, exact PHP version pinned in the image, extension excluded from production artifacts and blocked in CI policy. If the spike succeeds, we own the fork and the PHP-upgrade treadmill — say that out loud before starting. If we can't express the need as a clean interface that also works with a plain clock fake, we don't have a use case; we have a workaround.
How can I help you explore Laravel packages today?