5.2.17

Latest release in branch 5.2
Released 15 years ago (January 06, 2011)

Software PHP
Branch 5.2
Status
End of life
End of bug fixes January 06, 2010
End of security fixes January 06, 2011
First official release version 5.2.0
First official release date 19 years ago (November 02, 2006)
Release notes https://www.php.net/ChangeLog-5.php#5.2.17
Source code https://github.com/php/php-src/tree/php-5.2.17
Documentation https://www.php.net/manual/en/
Download https://www.php.net/releases/5.2.17
PHP 5.2 Releases View full list

What Is New in PHP 5.2

PHP 5.2 delivers key improvements in memory management, security, and developer tooling. The introduction of a new memory manager and the JSON extension are the headline features for this release.

Category Key Changes
New Features JSON extension, Filter extension, Zip extension, mysqli prepared statements
Memory Management New Zend Engine memory manager for improved performance
Security Input filtering API, OpenID support, allow_url_include directive disabled by default
Deprecated define_syslog_variables(), set_magic_quotes_runtime(), magic_quotes_sybase
Improvements Faster hash functions, better SSL support, OCI8 enhancements

What are the major new extensions in PHP 5.2?

PHP 5.2 bundles several new extensions that became core components. The JSON extension (ext/json) is the most significant, providing json_encode() and json_decode() for seamless data interchange with JavaScript and web APIs.

The Filter extension (ext/filter) offers a standardized input validation API, a major step up from manual checks. The Zip extension (ext/zip) enables creating and reading zip archives directly from PHP scripts.

How does the new memory manager improve performance?

The new Zend Engine memory manager reduces overall memory usage and improves performance for large-scale applications. It's more efficient at handling the allocation and deallocation of memory blocks during script execution.

In practice, this means applications can handle more concurrent users or process larger datasets without hitting memory limits as quickly. The internal change is transparent but provides a solid foundation for the engine's future development.

What security enhancements were introduced?

Security got a major boost with the new Filter API for validating and sanitizing user input. The allow_url_include directive is now disabled by default, closing a common remote code inclusion vulnerability.

OpenID support was added for decentralized authentication. The hash extension received faster implementations of algorithms like SHA-256 and SHA-512, which are crucial for secure password hashing.

Which features were deprecated and need updating?

This release started the cleanup of old, insecure practices. The set_magic_quotes_runtime() function and the magic_quotes_sybase directive were deprecated, signaling the end of the problematic magic quotes feature.

The define_syslog_variables() function was also deprecated. If you're upgrading from an older version, your code should be audited for these functions to ensure future compatibility.

What database and SSL improvements were made?

The mysqli extension gained support for prepared statements, a safer way to handle user input in database queries. The OCI8 extension for Oracle Database saw numerous fixes and improvements.

SSL support was enhanced across extensions. Stream wrappers gained more secure options, and the OpenSSL extension became more robust for handling certificates and encrypted connections.

FAQ

Is the JSON extension built-in or do I need to install it?
It's now a core extension bundled with PHP 5.2. You can start using json_encode() and json_decode() immediately without any additional installation.

Why was allow_url_include turned off by default?
This was a critical security fix. Including code from remote URLs is a massive risk, and disabling it by default prevents many common attack vectors in poorly secured applications.

What should I use instead of the deprecated magic quotes functions?
Use the new Filter extension API or manually sanitize input with functions like mysql_real_escape_string() (for MySQL) or prepared statements. The Filter extension is the modern way to handle validation.

Does the new memory manager require any configuration?
No, it works automatically with no needed changes to your php.ini. It's an internal engine improvement that provides benefits out of the box.

Are there any breaking changes I should watch for when upgrading?
The main breaking change is the default disabling of allow_url_include. If your application relies on remote file includes, you'll need to explicitly enable it in your configuration, though this is not recommended.

Releases In Branch 5.2

Version Release date
5.2.17 15 years ago
(January 06, 2011)
5.2.16 15 years ago
(December 16, 2010)
5.2.15 15 years ago
(December 09, 2010)
5.2.14 15 years ago
(July 22, 2010)
5.2.13 16 years ago
(February 25, 2010)
5.2.12 16 years ago
(December 17, 2009)
5.2.11 16 years ago
(September 17, 2009)
5.2.10 16 years ago
(June 18, 2009)
5.2.9 17 years ago
(February 26, 2009)
5.2.8 17 years ago
(December 08, 2008)
5.2.6 17 years ago
(May 01, 2008)
5.2.5 18 years ago
(November 08, 2007)
5.2.4 18 years ago
(August 30, 2007)
5.2.3 18 years ago
(May 31, 2007)
5.2.2 18 years ago
(May 03, 2007)
5.2.1 19 years ago
(February 08, 2007)
5.2.0 19 years ago
(November 02, 2006)