
RustyPHP
RustyPHP is an experimental PHP compiler built in Rust, aiming to modernize PHP runtime with performance, safety, and extensibility.
Contribute
Become a financial contributor.
Financial Contributions
RustyPHP is all of us
Our contributors 1
Thank you for supporting RustyPHP.
About
RustyPHP – A Clean-Room PHP Implementation in Rust
RustyPHP is a complete, independent PHP implementation written in Rust, designed with three core values in mind: performance, safety, and compatibility.
Our vision is to create a production-ready, memory-safe, and high-performance alternative to the Zend PHP engine. By leveraging Rust’s zero-cost abstractions and strict ownership model, we aim to eliminate entire classes of memory vulnerabilities while unlocking modern concurrency and async support.
🎯 Vision & Goals
- Performance: Achieve 20–30% faster execution than PHP 8.x.
- Memory Safety: Guarantee zero memory vulnerabilities through Rust’s ownership model.
- Compatibility: Support 95%+ compatibility with existing PHP 8.x codebases.
- Modularity: Provide a clean, extensible multi-crate architecture.
- Modern Features: Native async support and improved concurrency.
🏗️ Architecture
RustyPHP is structured as a modular Rust workspace with clearly defined crates:
- php-cli: Command line runtime.
- php-web: Web server interface.
- php-ffi: Foreign function interface for interoperability.
- php-runtime & php-stdlib: Core execution engine and standard library.
- php-parser & php-lexer: Language frontend.
- php-types: Shared type system.
This separation of concerns ensures that RustyPHP can evolve rapidly and be extended by the community.
🚀 Current Progress
We’ve already implemented the first major phase of the project, including:
- Lexical analysis and syntax parsing (functions, control flow, arrays, match expressions, closures, destructuring).
- Runtime execution for arithmetic, comparison, concatenation, null coalescing, ternary operators, arrays, and more.
- A growing standard library with JSON handling, string utilities, array helpers, regex, and environment access.
- Interactive Playground with Monaco Editor (VS Code core) for live coding in the browser, syntax highlighting, auto-completion, performance metrics, and real-time execution.
- CLI support for running PHP scripts directly.
🔧 Active Development
- True closures with captured environments.
- Generators and proper yield semantics.
- Exception handling and stack traces.
- Full logical/identity operators (===, !==, &&, ||).
- Expanded standard library (validators, filters, advanced regex).
- Early steps towards an object model (classes, interfaces, traits).
📅 Roadmap
- Complete PHP 8.x language compatibility.
- Implement an object system and OOP semantics.
- Build a performance layer with intermediate representation and opcode optimization.
- Integrate an extension/FFI bridge and web SAPI.
- Long-term exploration of JIT and WebAssembly targets.
⚠️ Disclaimer
RustyPHP is a clean-room project and is not affiliated with, endorsed by, or sponsored by the PHP Group or Zend Engine authors. "PHP" is a trademark of the PHP Group (see TRADEMARKS.md).
📜 License
Apache 2.0 – fully open source.
🤝 Why We Need Support
RustyPHP is a large, multi-year effort that requires community backing to succeed. Your support on Open Collective will help us:
- Fund ongoing development and attract more contributors.
- Build documentation, learning resources, and tutorials.
- Maintain CI/CD, benchmarking, and infrastructure.
- Explore advanced optimizations and integrations that push PHP forward.
By contributing, you’re helping to build the next-generation PHP runtime — safer, faster, and future-proof.
Our team
Md. Aminul Is...
Admin