From CGI Scripts to PHP 8.4: How the Language Celebrates 29 Years of Evolution
This article chronicles PHP's 29‑year history—from its 1995 CGI origins and the pivotal rewrites by Gutmans and Suraski, through major releases like PHP 5, 7, and 8, up to the new features and improvements introduced in the upcoming PHP 8.4 version.
PHP Evolution Overview
PHP turned 29 on 8 June 2024. The language originated in 1995 when Rasmus Lerdorf wrote a set of CGI binaries in C to count visits to his online résumé. He called the collection Personal Home Page Tools, later shortened to PHP. The first public release, PHP 1, appeared the same year, and PHP/FI 2.0 marked the true birth of the language.
1997 – Andi Gutmans and Zeev Suraski rewrote the interpreter, creating PHP 3.0 and introducing the name “PHP: Hypertext Preprocessor” together with a new extension API.
Key milestones:
1998 – PHP 3.0 : First version to use the full name, adoption grew to roughly 10 % of web servers.
2000 – PHP 4.0 : Added built‑in MySQL support and the Zend Engine, enabling sessions, output buffering and broader server compatibility.
2004‑2005 – PHP 5 series : Introduced a modern object model and the second‑generation Zend Engine.
2009 – PHP 5.3 : Added namespaces, late static binding, closures and removed several legacy extensions.
2012 – PHP 5.4 : Added traits, a built‑in web server and multibyte language support.
2015 – PHP 7.0 : Delivered the Zend Engine 3 (PHPNG) with roughly a 2× speed increase over PHP 5.6, at the cost of some backward compatibility.
2020 – PHP 8.0 (26 Nov 2020): Introduced JIT compilation, named parameters, union types, attributes, the match expression and numerous performance and security improvements.
2023 – PHP 8.3 : Incremental enhancements to the type system and standard library.
2024 – PHP 8.4 (planned 21 Nov 2024) : Three alpha, three beta and six release‑candidate cycles are scheduled.
PHP 8.4 New Features
DOM extension supports HTML5
The DOM extension now provides a DOM\HTMLDocument class that can parse and serialise HTML5 documents, handling modern tags and embedded JavaScript correctly.
use DOM\HTMLDocument;
// Parse from a string
$htmlDocument = HTMLDocument::createFromString('<!DOCTYPE html><html><body>Hello, HTML5!</body></html>');
// Or load from a file
$htmlDocument = HTMLDocument::createFromFile('path/to/your/file.html');RFC: https://wiki.php.net/rfc/domdocument_html5_parser
Increased default bcrypt cost
PHP 8.4 raises the default cost factor for the password_hash() bcrypt algorithm from 10 to 12, strengthening resistance against brute‑force attacks while adding only a few milliseconds of latency per hash.
RFC: https://wiki.php.net/rfc/bcrypt_cost_2023
More reliable large XML parsing
A new parser option fixes a regression in ext/xml that occurred with libxml2 2.7.0, which previously caused parsing errors for very large documents when using xml_parse() or xml_parse_into_struct(). The option enables correct handling of huge XML files without requiring work‑arounds.
RFC: https://wiki.php.net/rfc/xml_option_parse_huge
New multibyte trim functions
The mbstring extension adds three multibyte‑safe trimming functions, eliminating the need for complex regular‑expression workarounds. mb_trim($string, $characters = null) – Trims characters from both ends of the string. mb_ltrim($string, $characters = null) – Trims characters from the left side. mb_rtrim($string, $characters = null) – Trims characters from the right side.
When $characters is omitted, the functions default to a predefined set of whitespace characters, covering most Unicode space characters but not every possible code point due to storage and compatibility constraints.
RFC: https://wiki.php.net/rfc/mb_trim
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Open Source Tech Hub
Sharing cutting-edge internet technologies and practical AI resources.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
