Release Information
- Release Type
- Bug Fix Release
- Release Status
- QA Release Latest
- Branch Status
- Upcoming Release
PHP 8.5 is a development version, and is not recommended for production use. PHP 8.5 is scheduled to reach General Availability on 2025-11-20. This is the latest QA release in the series.
Downloads
Source Code
Git Clone
Use Git to clone the 8.5.0alpha1 tag from the PHP Git repository.
git clone https://github.com/php/php-src.git --depth 1 --branch php-8.5.0alpha1
How to compile PHP
PHP can be compiled by setting up the dependencies, building the configure script (
Detailed articles on how to compile PHP are available for Ubuntu/Debian based systems and Fedora/RHEL based systems.
./buildconf
), configuring the build ./configure
, and running make
.Detailed articles on how to compile PHP are available for Ubuntu/Debian based systems and Fedora/RHEL based systems.
Windows binaries
Non-Thread Safe Builds
Non-Thread Safe (NTS) builds are single-threaded PHP builds. They can be used on web servers that integrate PHP over FastCGI protocol, such as Nginx, Caddy, and IIS.
php-8.5.0alpha1-x64NTS.zip (32.31 MiB)
php-8.5.0alpha1-x86NTS.zip (29 MiB)
Thread-Safe Builds
Thread-Safe (TS) builds are multi-thread PHP builds, often used to integrate PHP as a Server API for multithreaded servers. The most common use case is using PHP as an Apache module.
php-8.5.0alpha1-x64TS.zip (32.44 MiB)
php-8.5.0alpha1-x86TS.zip (29.00 MiB)
Docker/Podman Containers
PHP CLI
PHP CLI Containers images only include the PHP CLI, and no FPM or Apache modules. The Alpine builds are lightweight, but may introduce incompatibilities due to their musl builds. Albeit their larger size, the Debian-based (without the "-alpine" suffix) images are more complete, and widely used.
Alpine-based: Lightweight, but may introduce incompatibilities due to their musl builds.
docker pull php:8.5.0alpha1-cli-alpine
Debian-based: More compatible with other components, complete, and are widely used.
docker pull php:8.5.0alpha1-cli
PHP CLI + Web Server Integration
These container images include PHP CLI, and a web server integration. FPM container images can be integrated with web servers such as Nginx, Caddy, and Apache with Event MPM. The Apache container images include Apache web server, integrating PHP as an Apache module.
Alpine-based: Lightweight, but may introduce incompatibilities due to their musl builds.
docker pull php:8.5.0alpha1-fpm-alpine
Debian-based ZTS Apache: Includes Apache web server integrating PHP as an Apache module.
docker pull php:8.5.0alpha1-apache
Debian-based NTS FPM: PHP-FPM, can be integrated with Nginx, Caddy, and other web servers over Fast CGI.
docker pull php:8.5.0alpha1-fpm
ChangeLog
BCMath
- Simplify
bc_divide()
code. - If the result is 0, n_scale is set to 0.
- If size of BC_VECTOR array is within 64 bytes, stack area is now used.
CLI
- Add
--ini
=diff to print INI settings changed from the builtin default. - Drop support for -z CLI/CGI flag.
- Fixed GH-17956 - development server 404 page does not adapt to mobiles.
CURL
- Added CURLFOLLOW_ALL, CURLFOLLOW_OBEYCODE and CURLFOLLOW_FIRSTONLY values for
CURLOPT_FOLLOLOCATION
curl_easy_setopt
option.
COM
- Fixed property access of PHP objects wrapped in variant.
- Fixed method calls for PHP objects wrapped in variant.
Core
- Fixed bug GH-16665 (\array and \callable should not be usable in class_alias).
- Added
PHP_BUILD_DATE
constant. - Added support for Closures and first class callables in constant expressions.
- Use
clock_gettime_nsec_np()
for high resolution timer on macOS if available. - Implement GH-15680 (Enhance
zend_dump_op_array
to properly represent non-printable characters in string literals). - Add support for backtraces for fatal errors.
- Fixed bug GH-17442 (Engine UAF with reference assign and dtor).
- Improved error message of UnhandledMatchError for zend.exception_string_param_max_len=0.
- Fixed bug GH-17959 (Relax missing trait fatal error to error exception).
- Fixed bug GH-18033 (NULL-ptr dereference when using register_tick_function in destructor).
- Fixed bug GH-18026 (Improve "expecting token" error for ampersand).
- Added the #[\NoDiscard] attribute to indicate that a function's return value is important and should be consumed.
- Added the (void) cast to indicate that not using a value is intentional.
- Added
get_error_handler()
,get_exception_handler()
functions. - Fixed bug GH-15753 and GH-16198 (Bind traits before parent class).
- Added support for casts in constant expressions.
- Fixed bugs GH-17711 and GH-18022 (Infinite recursion on deprecated attribute evaluation) and GH-18464 (Recursion protection for deprecation constants not released on bailout).
- Fixed AST printing for immediately invoked Closure.
- Properly handle
__debugInfo
() returning an array reference. - Properly handle reference return value from
__toString
(). - Added the pipe (|>) operator.
- Added support for
final
with constructor property promotion. - Do not use RTLD_DEEPBIND if dlmopen is available.
- Make
clone()
a function.
Curl
- Added
curl_multi_get_handles()
. - Added
curl_share_init_persistent()
. - Added
CURLINFO_USED_PROXY
,CURLINFO_HTTPAUTH_USED
, andCURLINFO_PROXYAUTH_USED
support tocurl_getinfo
.
Date
- Fix undefined behaviour problems regarding integer overflow in extreme edge cases.
DOM
- Added Dom\Element::$outerHTML.
- Added Dom`Element::insertAdjacentHTML()`.
- Added $children property to ParentNode implementations.
Enchant
- Added
enchant_dict_remove_from_session()
. - Added
enchant_dict_remove()
. - Fix missing empty string checks.
EXIF
- Add OffsetTime* Exif tags.
Fileinfo
- Upgrade to file 5.46.
- Change return type of
finfo_close()
to true.
FPM
- Fixed GH-17645 (FPM with httpd ProxyPass does not decode script path).
GD
- Fixed bug #68629 (Transparent artifacts when using imagerotate).
- Fixed bug #64823 (ZTS GD fails to to find system TrueType font).
Intl
- Bumped ICU requirement to ICU >= 57.1.
- IntlDateFormatter::setTimeZone()/
datefmt_set_timezone()
throws an exception with uninitialised classes or clone failure. - Added DECIMAL_COMPACT_SHORT/DECIMAL_COMPACT_LONG for NumberFormatter class.
- Added
Locale::isRightToLeft
to check if a locale is written right to left. - Added null bytes presence in locale inputs for Locale class.
- Added
grapheme_levenshtein()
function. - Added Locale::addLikelySubtags/
Locale::minimizeSubtags
to handle adding/removing likely subtags to a locale. - Added IntlListFormatter class to format a list of items with a locale , operands types and units.
- Fixed bug GH-18566 ([intl] Weird numeric sort in Collator).
LDAP
- Allow
ldap_get_option
to retrieve global option by allowing NULL for connection instance ($ldap).
MySQLi
MySQLnd
- Added
mysqlnd.c
ollect_memory_statistics to ini quick reference.
Opcache
- Fixed ZTS OPcache build on Cygwin.
- Added opcache.file_cache_read_only.
- Updated default value of opcache.jit_hot_loop.
- Log a warning when opcache lock file permissions could not be changed.
Output
- Fixed calculation of aligned buffer size.
PCNTL
- Extend
pcntl_waitid
with rusage parameter.
PCRE
- Upgraded to pre2lib from 10.44 to 10.45.
- Remove PCRE2_EXTRA_ALLOW_LOOKAROUND_BSK from pcre compile options.
PDO_PGSQL
- Added Iterable support for
PDO::pgsqlCopyFromArray
. - Implement GH-15387 Pdo\Pgsql::setAttribute(
PDO::ATTR_PREFETCH
, 0) or Pdo\Pgsql::prepare(…, [PDO::ATTR_PREFETCH
=> 0 ]) makefetch()
lazy instead of storing the whole result set in memory
PDO_SQLITE
- throw on null bytes / resolve GH-13952
- Implement GH-17321: Add setAuthorizer to Pdo\Sqlite.
PDO::sqliteCreateCollation
now throws a TypeError if the callback has a wrong return type.- Added Pdo_Sqlite::ATTR_BUSY_STATEMENT constant to check if a statement is currently executing.
- Added Pdo_Sqlite::ATTR_EXPLAIN_STATEMENT constant to set a statement in either EXPLAIN_MODE_PREPARED, EXPLAIN_MODE_EXPLAIN, EXPLAIN_MODE_EXPLAIN_QUERY_PLAN modes.
PGSQL
- Added pg_close_stmt to close a prepared statement while allowing its name to be reused.
- Added Iterable support for pgsql_copy_from.
- pg_connect checks if connection_string contains any null byte, pg_close_stmt check if the statement contains any null byte.
- Added pg_service to get the connection current service identifier.
POSIX
- Added POSIX_SC_OPEN_MAX constant to get the number of file descriptors a process can handle.
posix_ttyname()
sets last_error to EBADF on invalid file descriptors,posix_isatty()
raises E_WARNING on invalid file descriptors, posix_fpathconf checks invalid file descriptors.
Random
- Moves from /dev/urandom usage to arc4random_buf on Haiku.
Reflection
- Added
ReflectionConstant::getExtension()
and ::getExtensionName(). - Fixed bug GH-12856 (
ReflectionClass::getStaticPropertyValue()
returns UNDEF zval for uninitialized typed properties). - Fixed bug GH-15766 (
ReflectionClass::toString()
should have better output for enums).
Session
session_start()
throws a ValueError on option argument if not a hashmap or a TypeError if read_and_close value is not compatible with int.
SimpleXML
- Fixed bug GH-12231 (SimpleXML xpath should warn when returning other return types than node lists).
SNMP
- snmpget, snmpset, snmp_get2, snmp_set2, snmp_get3, snmp_set3 and
SNMP::__construct()
throw an exception on invalid hostname, community timeout and retries arguments.
SOAP
- Fixed bug #49169 (SoapServer calls wrong function, although "SOAP action" header is correct).
- Fix namespace handling of WSDL and XML schema in SOAP, fixing at least GH-16320 and bug #68576.
- Fixed bug #70951 (Segmentation fault on invalid WSDL cache).
- Implement request #55503 (Extend
__getTypes
to support enumerations). - Implement request #61105 (Support Soap 1.2 SoapFault Reason Text lang attribute).
Sockets
- Added IPPROTO_ICMP/IPPROTO_ICMPV6 to create raw socket for ICMP usage.
- Added
TCP_FUNCTION_BLK
to change the TCP stack algorithm on FreeBSD. socket_set_option()
catches possible overflow with SO_RCVTIMEO/SO_SNDTIMEO
with timeout setting on windows.- Added
TCP_FUNCTION_ALIAS
,TCP_REUSPORT_LB_NUMA
,TCP_REUSPORT_LB_NUMA_NODOM
,TCP_REUSPORT_LB_CURDOM
,TCP_BBR_ALGORITHM
constants. socket_create_listen()
throws an exception on invalid port value.socket_bind()
throws an exception on invalid port value.socket_sendto()
throws an exception on invalid port value.socket_addrinfo_lookup
throws an exception on invalid hints value types.socket_addrinfo_lookup
throws an exception if any of the hints value overflows.socket_addrinfo_lookup
throws an exception if one or more hints entries has an index as numeric.socket_set_option
with the options MCAST_LEAVE_GROUP/MCAST_LEAVE_SOURCE_GROUP will throw an exception if its value is not a valid array/object.- socket_getsockname/socket_create/
socket_bind
handled AF_PACKET family socket. - Added IP_BINDANY for a socket to bind to any address.
- Added
SO_BUSY_POOL
to reduce packets poll latency. - Added UDP_SEGMENT support to optimise multiple large datagrams over UDP if the kernel and hardware supports it.
- Added SHUT_RD, SHUT_WR and SHUT_RDWR constants for
socket_shutdown()
.
Sodium
- Fix overall theorical overflows on
zend_string
buffer allocations. (David Carlier/nielsdos)
Sqlite
- Added Sqlite3Stmt::busy to check if a statement is still being executed.
- Added Sqlite3Stmt::explain to produce a explain query plan from the statement.
- Added Sqlite3Result::fetchAll to returns all results at once from a query.
Standard
- Fixed
crypt()
tests on musl when using--with-external-libcrypt
- Fixed bug GH-18062 (is_callable(func(...), callable_name: $name) for first class callables returns wrong name).
- Added
array_first()
andarray_last()
. - Fixed bug GH-18823 (setlocale's 2nd and 3rd argument ignores strict_types).
- Fixed exit code handling of sendmail cmd and added warnings.
- Fixed bug GH-18897 (printf: empty precision is interpreted as precision 6, not as precision 0).
Streams
- Fixed bug GH-16889 (
stream_select()
timeout useless for pipes on Windows).
Tests
- Allow to shuffle tests even in non-parallell mode.
Tidy
- tidy::__construct/parseFile/parseString methods throw an exception if the configuration argument is invalid.
Windows
- Fixed bug GH-10992 (Improper long path support for relative paths).
- Fixed bug GH-16843 (Windows phpize builds ignore source subfolders).
XMLWriter
- Improved performance and reduce memory consumption.
XSL
- Implement request GH-30622 (make $namespace parameter functional).