What is PHP 7.3? Unpacking a Pivotal Web Development Release

In the dynamic world of web development, programming languages are in constant evolution, striving for greater efficiency, security, and developer convenience. Among these, PHP (Hypertext Preprocessor) has long held a foundational position, powering a vast majority of the internet’s most visited websites and applications, from content management systems like WordPress to sophisticated e-commerce platforms. The journey of PHP has been marked by significant milestones, each version bringing a suite of improvements that have collectively shaped the modern web. Among these iterations, PHP 7.3, released on December 6, 2018, stands out as a particularly robust and impactful update within the widely adopted PHP 7 series.

PHP 7.3 wasn’t a revolutionary overhaul in the same vein as the leap from PHP 5 to PHP 7, which introduced the Zend Engine 3.0 and brought unprecedented performance gains. Instead, PHP 7.3 was a refinement, a meticulous polish on the already strong foundation laid by PHP 7.0, 7.1, and 7.2. It solidified many of the performance enhancements and language improvements, while also introducing critical new features and deprecations that streamlined code, bolstered security, and further optimized resource usage. For developers and businesses alike, understanding what PHP 7.3 brought to the table is crucial for appreciating its role in maintaining a robust, performant, and secure web ecosystem during its active support lifecycle and its lasting influence on subsequent PHP versions. It addressed specific pain points, offered more intuitive ways to write common code, and laid important groundwork for future advancements, making it a critical step in PHP’s continuous modernization.

The Evolution of PHP: A Brief Historical Context

To truly grasp the significance of PHP 7.3, it’s essential to understand the broader context of PHP’s journey. Born in 1994 as a simple set of Perl scripts by Rasmus Lerdorf, designed for tracking his online resume, PHP quickly grew into a general-purpose scripting language widely embraced for web development. Its open-source nature, ease of use, and strong community support propelled it to become one of the most popular server-side languages.

From CGI to Modern Frameworks

In its early days, PHP was primarily used for generating dynamic HTML pages, often embedding code directly within HTML. This straightforward approach made it accessible, particularly for those migrating from static web pages. Over time, as web applications grew in complexity, PHP evolved beyond simple templating. The introduction of object-oriented programming (OOP) features in PHP 4 and greatly enhanced in PHP 5 allowed developers to build more modular, maintainable, and scalable applications. This era saw the rise of powerful PHP frameworks like Zend Framework, Symfony, and Laravel, which provided structured environments for building enterprise-grade applications, moving PHP from a “personal home page” tool to a robust language capable of handling complex business logic and massive traffic. The language transitioned from being tightly coupled with HTML to a more abstracted, MVC (Model-View-Controller) pattern-driven development paradigm, significantly improving code organization and reusability.

The Leap to PHP 7: Performance and Language Shifts

While PHP 5 was a significant advancement in terms of object orientation and database interaction, it eventually faced criticism for its performance relative to other modern languages. The perceived speed limitations became a major concern for large-scale applications. This led to a monumental effort within the PHP community to re-engineer the core engine, culminating in the release of PHP 7.0 in late 2015. PHP 7.0 marked a paradigm shift, delivering unprecedented performance improvements, often making applications run twice as fast with significantly reduced memory consumption compared to PHP 5.6. This was achieved through the new Zend Engine 3.0, which focused heavily on optimizing internal data structures and instruction execution.

Beyond performance, PHP 7.0 introduced crucial language features such as scalar type declarations (for integers, floats, strings, and booleans) and return type declarations, improving code clarity and enabling static analysis tools. The null coalescing operator (??) also made code more concise. Subsequent versions, PHP 7.1 and 7.2, continued this trend, adding further performance tweaks, new language constructs like nullable types, void return types, and class constant visibility modifiers, as well as crucial security enhancements like Libsodium integration for cryptographic operations in PHP 7.2. These incremental but impactful updates laid a solid foundation, setting the stage for PHP 7.3 to further refine and stabilize the PHP 7 series.

Key Features and Enhancements Introduced in PHP 7.3

PHP 7.3 built upon the strengths of its predecessors, introducing a suite of features designed to make code cleaner, more secure, and more efficient. These additions were largely incremental but collectively contributed to a significantly improved developer experience and application performance.

Flexible Heredoc and Nowdoc Syntax

One of the most welcomed changes in PHP 7.3 was the enhanced flexibility for Heredoc and Nowdoc syntax. Before 7.3, the closing marker for these multi-line string definitions had to be placed on a new line, flush against the left margin (no indentation), followed immediately by a semicolon. This often led to messy code formatting, especially within indented blocks. PHP 7.3 relaxed this rule, allowing the closing marker to be indented, provided it is indented by at least the same level as the opening marker, and the indentation uses only spaces or tabs. This seemingly minor change significantly improved code readability and maintainability, allowing developers to properly indent multi-line strings within functions or classes without breaking the syntax. For instance:

function example() {
    $html = <<<HTML
        <div>
            <h1>Hello, World!</h1>
        </div>
    HTML;
    return $html;
}

This became valid, making code much tidier.

List Reference Assignment

PHP 7.3 introduced the ability to use list() assignments by reference. Previously, list() could only assign values by copy. With 7.3, you could now assign by reference, which is particularly useful when working with arrays and needing to modify their elements directly. For example:

$data = [1, 2, 3];
list($a, &$b, $c) = $data; // $b is now a reference to $data[1]
$b = 10;
// $data is now [1, 10, 3]

This enhancement provided more flexibility and performance gains in scenarios where copying large values was inefficient.

PCRE2 JIT Optimization (Internal)

While not a direct language feature for developers, an important internal improvement in PHP 7.3 was the adoption of PCRE2 (Perl Compatible Regular Expressions 2) with JIT (Just-In-Time) compilation. This updated regular expression engine offered significant performance boosts for regex operations, which are ubiquitous in web development for validation, parsing, and string manipulation. By leveraging JIT compilation, PCRE2 could compile regular expressions into native machine code at runtime, leading to faster execution times for complex patterns. This change had a silent but profound impact on the performance of applications that heavily relied on regular expressions, making many common operations faster under the hood.

is_countable() Function

Prior to PHP 7.3, checking if a variable was “countable” (i.e., if it was an array or an object implementing the Countable interface) required a rather verbose check: is_array($var) || $var instanceof Countable. Attempting to count() an uncountable variable would result in a warning. PHP 7.3 introduced the is_countable() function to simplify this common check:

if (is_countable($my_variable)) {
    echo count($my_variable);
}

This new function made code cleaner and prevented potential warnings or errors when dealing with unknown variable types, contributing to more robust and error-resistant codebases.

Argon2 Hashing for Enhanced Security

Security is paramount in web development, and PHP 7.3 significantly bolstered its cryptographic capabilities by providing native support for the Argon2 hashing algorithm. Argon2 was chosen as the winner of the Password Hashing Competition (PHC) in 2015 and is widely regarded as a superior algorithm for password hashing compared to bcrypt (which was the default in password_hash() prior to 7.3) and older algorithms like MD5 or SHA-1. Argon2 is designed to be resistant to various attacks, including GPU-based brute-force attacks and side-channel attacks, due to its configurable memory requirements, iteration count, and parallelism. PHP 7.3 integrated Argon2 into the password_hash() and password_verify() functions, allowing developers to easily switch to this more secure hashing scheme:

$password = 'my_secret_password';
$hash = password_hash($password, PASSWORD_ARGON2ID); // or PASSWORD_ARGON2I, PASSWORD_ARGON2ID
if (password_verify($password, $hash)) {
    echo 'Password is valid!';
}

This was a critical security upgrade, making it easier for developers to implement stronger password security practices without relying on complex external libraries.

Performance Gains and Efficiency

While PHP 7.0 delivered the monumental performance leap, subsequent versions, including PHP 7.3, continued to fine-tune the engine, resulting in further incremental but noticeable performance gains. These optimizations were crucial for sustaining PHP’s competitiveness against other server-side languages.

Benchmarking PHP 7.3: Real-World Impacts

Benchmarking studies conducted upon PHP 7.3’s release consistently showed it to be faster than its immediate predecessors, PHP 7.0, 7.1, and 7.2. While the gains weren’t as dramatic as the jump from PHP 5 to PHP 7, they were significant enough to warrant upgrades for performance-sensitive applications. Popular applications like WordPress, Drupal, and Magento, when run on PHP 7.3, demonstrated faster page load times and higher request throughput compared to older 7.x versions. This meant that web servers could handle more concurrent users with the same hardware, or deliver a snappier experience to existing users, directly translating into better user engagement and reduced infrastructure costs for businesses. These improvements were often a result of numerous small optimizations within the Zend Engine and standard library functions.

Reduced Memory Footprint and Faster Execution

Beyond raw execution speed, PHP 7.3 also contributed to a more efficient use of system resources. Each incremental update in the PHP 7 series focused on reducing the memory footprint of PHP processes. For shared hosting environments and large-scale applications with many concurrent users, even marginal reductions in memory usage per request can lead to substantial overall savings and improved stability. Coupled with faster execution, this meant that PHP 7.3 could serve requests quicker, freeing up server resources sooner, and allowing more tasks to be processed within the same timeframe. These gains were often the result of more optimized internal data structures, better garbage collection mechanisms, and more efficient function implementations, which, though invisible to the end-user, were vital for the scalability and cost-effectiveness of PHP applications.

Impact on Modern Web Development

PHP 7.3’s introduction had a multifaceted impact on the landscape of modern web development, influencing security practices, developer workflows, and the broader PHP ecosystem.

Security Improvements and Best Practices

The most prominent security enhancement in PHP 7.3 was the native integration of Argon2 for password hashing. This immediately elevated the baseline security for new applications or those undergoing refactoring. It provided developers with an industry-leading, memory-hard hashing algorithm, mitigating the risks of credential compromise. Furthermore, the continuous patching and bug fixes that came with PHP 7.3’s active support period ensured that known vulnerabilities were swiftly addressed, contributing to a more secure operating environment for web applications. Developers were encouraged to adopt PASSWORD_ARGON2ID as the preferred algorithm, establishing a new best practice for securing user credentials.

Developer Experience and Productivity

The smaller, quality-of-life improvements in PHP 7.3 significantly boosted developer experience. Features like flexible Heredoc/Nowdoc syntax eliminated frustrating formatting constraints, allowing for cleaner, more readable code. The is_countable() function streamlined common checks, reducing boilerplate code and making applications more resilient to unexpected data types. These seemingly minor changes reduced friction in the development process, allowing developers to focus more on business logic and less on wrestling with syntax quirks or verbose checks. The overall effect was an increase in developer productivity and a reduction in potential sources of error.

Compatibility and Migration Challenges

As with any major version update, migrating to PHP 7.3 from older versions (especially PHP 5.x) presented some compatibility challenges. While the jump from 7.2 to 7.3 was generally smooth for well-maintained applications, those running on very old PHP versions often required significant refactoring. Deprecations, such as the image2wbmp() function and case-insensitive constants in some contexts, meant that developers needed to update their codebases. However, the benefits of migrating — including enhanced security, performance, and access to new language features — typically outweighed the effort. Most popular frameworks and content management systems quickly released compatible versions or guides to facilitate the upgrade, demonstrating the strong commitment of the PHP community to maintain backward compatibility where possible, while still pushing forward with improvements.

The Legacy of PHP 7.3 and Future Directions

While PHP 7.3 has since reached its end-of-life for active support (in December 2020) and security support (in December 2021), its contributions to the PHP ecosystem are enduring. It played a crucial role in stabilizing and refining the PHP 7 series, serving as a robust and reliable platform for countless applications during its active phase.

Laying the Groundwork for PHP 7.4 and PHP 8

PHP 7.3 effectively served as a stepping stone to future, more significant releases. Its improvements laid much of the groundwork for PHP 7.4, which brought even more powerful features like typed properties, arrow functions, and the FFI (Foreign Function Interface). The continuous evolution seen in 7.3’s development cycle also informed the ambitious plans for PHP 8, which introduced the JIT compiler, union types, and named arguments, marking another major leap forward in PHP’s capabilities and performance. The stability and predictability of the 7.x series, underpinned by releases like 7.3, instilled confidence in developers and businesses to continue investing in the PHP platform.

Sustaining the PHP Ecosystem

The success of PHP 7.3, and the PHP 7 series as a whole, demonstrated the language’s resilience and commitment to modernization. It reaffirmed PHP’s position as a leading technology for web development, capable of powering everything from small blogs to massive enterprise applications. The performance gains, security enhancements, and developer-friendly features of 7.3 encouraged continued adoption and ensured that the vast ecosystem of PHP frameworks, libraries, and tools remained vibrant and relevant. Even today, many applications originally developed or optimized for PHP 7.3 still benefit from its solid architectural principles, which continue to influence how PHP applications are built and maintained. The cycle of continuous improvement, where each version refines and prepares the ground for the next, is a testament to PHP’s enduring strength and adaptability in the fast-paced world of technology.

aViewFromTheCave is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com. Amazon, the Amazon logo, AmazonSupply, and the AmazonSupply logo are trademarks of Amazon.com, Inc. or its affiliates. As an Amazon Associate we earn affiliate commissions from qualifying purchases.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top