PHP Compile-Time Generics: A Pragmatic Compromise

2025-08-11
PHP Compile-Time Generics: A Pragmatic Compromise

Generics have long been a sought-after feature for PHP, but runtime implementation has proven incredibly difficult. The PHP Foundation team proposes a different approach: compile-time generics limited to interfaces and abstract classes. This offers most of the benefits of generics while avoiding many pitfalls. By performing type checking at compile time, it significantly improves efficiency and reduces errors. While runtime generics remain impossible with this approach, it represents a substantial improvement, warranting serious community consideration.

Read more
Development Compile-Time

PHP 8.5's Pipe Operator: A Decade in the Making, Elegant Code Evolution

2025-08-05
PHP 8.5's Pipe Operator: A Decade in the Making, Elegant Code Evolution

PHP 8.5 is bringing a long-awaited feature: the pipe operator (|>). This deceptively simple yet powerful feature chains function calls, simplifying code and improving readability, much like Unix pipes. After years of development and several iterations, from its origins in Hack to its final implementation, it incorporates functional programming concepts, enabling chained calls and shining in contexts like match statements. Future PHP enhancements include exploration of partial function application and function composition operators, further boosting code efficiency and expressiveness.

Read more
Development Pipe Operator

PHP Security Audit Reveals and Patches Multiple Vulnerabilities

2025-04-14
PHP Security Audit Reveals and Patches Multiple Vulnerabilities

The PHP Foundation announces the completion of a comprehensive security audit of the PHP source code (php/php-src), commissioned by the Sovereign Tech Agency and conducted by Quarkslab. The two-month audit uncovered 27 issues, 17 of which had security implications, including four vulnerabilities assigned CVEs. These vulnerabilities have been addressed, and users are urged to upgrade to the latest PHP versions. The audit highlighted the overall high quality of the php/php-src project and underscores the PHP Foundation's commitment to enhancing PHP's security and reliability.

Read more
Development Vulnerability Patches