Yaf is a PHP framework written in C and built as a PHP extension.
Yaf addresses the performance overhead inherent in traditional PHP frameworks by implementing the entire MVC stack—routing, dispatching, and class loading—in compiled C code rather than interpreted PHP. Where conventional frameworks incur milliseconds of bootstrap overhead per request through Composer autoloading and PHP file inclusion, Yaf eliminates this cost by pre-loading framework components into the extension's shared memory. Application initialization and request dispatch cycles run in microseconds. The framework provides standard MVC components including controllers, routers, and configuration management, all exposed through a PHP API.
Yaf suits high-traffic applications where framework overhead becomes a measurable cost and long-lived services built on async runtimes like Swoole or RoadRunner, where eliminating per-request framework initialization and avoiding global state pollution across requests matters. The tool is not intended as a general-purpose replacement for mainstream PHP frameworks but rather as a specialized choice for performance-critical scenarios. The README recommends pairing Yaf with complementary C-native extensions from the same ecosystem: Yaconf for configuration parsing and Yac for runtime caching, both designed to eliminate per-request overhead in their respective domains.
Development activity shows consistent maintenance with regular updates addressing PHP compatibility and bug fixes. The project maintains multiple supported branches to serve different PHP versions, indicating attention to backward compatibility across the ecosystem. Documentation is centralized in the official PHP manual rather than duplicated in the repository, suggesting integration with PHP's official documentation processes. The tool provides extensive runtime configuration options for controlling naming conventions, autoloading behavior, and dispatch limits, reflecting a mature codebase refined through production use.