1PHP 8.5 UPGRADE NOTES 2 31. Backward Incompatible Changes 42. New Features 53. Changes in SAPI modules 64. Deprecated Functionality 75. Changed Functions 86. New Functions 97. New Classes and Interfaces 108. Removed Extensions and SAPIs 119. Other Changes to Extensions 1210. New Global Constants 1311. Changes to INI File Handling 1412. Windows Support 1513. Other Changes 1614. Performance Improvements 17 18======================================== 191. Backward Incompatible Changes 20======================================== 21 22- BZ2: 23 . bzcompress() now throws a ValueError when $block_size is not between 24 1 and 9. 25 . bzcompress() now throws a ValueError when $work_factor is not between 26 0 and 250. 27 28- Core: 29 . It is no longer possible to use "array" and "callable" as class alias names 30 in class_alias(). 31 . Loosely comparing uncomparable objects (e.g. enums, \CurlHandle and other 32 internal classes) to booleans was previously inconsistent. If compared to a 33 boolean literal $object == true, it would behave the same way as (bool) 34 $object. If compared to a statically unknown value $object == $true, it 35 would always return false. This behavior was consolidated to always follow 36 the behavior of (bool) $object. 37 . The return value of gc_collect_cycles() no longer includes strings and 38 resources that were indirectly collected through cycles. 39 40- Intl: 41 . The extension now requires at least ICU 57.1. 42 43- LDAP: 44 . ldap_get_option() and ldap_set_option() now throw a ValueError when 45 passing an invalid option. 46 47- PCNTL: 48 . pcntl_exec() now throws ValueErrors when entries of the $args parameter 49 contain null bytes. 50 . pcntl_exec() now throws ValueErrors when entries or keys of the 51 $env_vars parameter contain null bytes. 52 53- PDO_FIREBIRD: 54 . A ValueError is now thrown when trying to set a cursor name that is too 55 long on a PDOStatement resulting from the Firebird driver. 56 57- SPL: 58 . ArrayObject no longer accepts enums, as modifying the $name or $value 59 properties can break engine assumptions. 60 61======================================== 622. New Features 63======================================== 64 65- Core: 66 . Added support for Closures in constant expressions. 67 RFC: https://wiki.php.net/rfc/closures_in_const_expr 68 69- DOM: 70 . Added Dom\Element::$outerHTML. 71 72- XSL: 73 . The $namespace argument of XSLTProcessor::getParameter(), 74 XSLTProcessor::setParameter() and XSLTProcessor::removeParameter() 75 now actually works instead of being treated as empty. 76 This only works if the $name argument does not use Clark notation 77 and is not a QName because in those cases the namespace is taken 78 from the namespace href or prefix respectively. 79 80======================================== 813. Changes in SAPI modules 82======================================== 83 84- CLI: 85 . Trying to set a process title that is too long with cli_set_process_title() 86 will now fail instead of silently truncating the given title. 87 88======================================== 894. Deprecated Functionality 90======================================== 91 92- Hash: 93 The MHASH_* constants have been deprecated. These have been overlooked 94 when the mhash*() function family has been deprecated per 95 https://wiki.php.net/rfc/deprecations_php_8_1#mhash_function_family 96 97======================================== 985. Changed Functions 99======================================== 100 101- Zlib: 102 . The "use_include_path" argument for the 103 gzfile, gzopen and readgzfile functions had been changed 104 from int to boolean. 105 106- PCNTL: 107 . pcntl_exec() now has a formal return type of false. 108 109- PDO_PGSQL: 110 . PDO::pgsqlCopyFromArray also supports inputs as Iterable. 111 . Pdo\Pgsql::setAttribute and Pdo\Pgsql::prepare supports 112 PDO::ATTR_PREFETCH sets to 0 which set to lazy fetch mode. 113 In this mode, statements cannot be run parallely. 114 115- PGSQL: 116 . pg_copy_from also supports inputs as Iterable. 117 118- POSIX: 119 . posix_ttyname sets last_error to EBADF when encountering 120 an invalid file descriptor. 121 . posix_isatty raises an E_WARNING message when encountering 122 an invalid file descriptor. 123 . posix_fpathconf checks invalid file descriptors and sets 124 last_error to EBADF and raises an E_WARNING message. 125 126======================================== 1276. New Functions 128======================================== 129 130- Curl: 131 . curl_multi_get_handles() allows retrieving all CurlHandles current 132 attached to a CurlMultiHandle. This includes both handles added using 133 curl_multi_add_handle() and handles accepted by CURLMOPT_PUSHFUNCTION. 134 135- DOM: 136 . Added Dom\Element::insertAdjacentHTML(). 137 138- PGSQL: 139 . pg_close_stmt offers an alternative way to close a prepared 140 statement from the DEALLOCATE sql command in that we can reuse 141 its name afterwards. 142 143- Reflection: 144 . ReflectionConstant::getFileName() was introduced. 145 . ReflectionConstant::getExtension() and 146 ReflectionConstant::getExtensionName() were introduced. 147 148======================================== 1497. New Classes and Interfaces 150======================================== 151 152======================================== 1538. Removed Extensions and SAPIs 154======================================== 155 156======================================== 1579. Other Changes to Extensions 158======================================== 159 160- Readline: 161 . The return types of readline_add_history(), readline_clear_history(), and 162 readline_callback_handler_install() have been changed to true, rather 163 than bool. 164 165======================================== 16610. New Global Constants 167======================================== 168 169- Core: 170 . PHP_BUILD_DATE. 171 172- POSIX: 173 . POSIX_SC_OPEN_MAX. 174 175- Sockets: 176 . IPPROTO_ICMP/IPPROTO_ICMPV6. 177 . TCP_FUNCTION_BLK (FreeBSD only). 178 179======================================== 18011. Changes to INI File Handling 181======================================== 182 183- Opcache: 184 . Added opcache.file_cache_read_only to support a read-only 185 opcache.file_cache directory, for use with read-only file systems 186 (e.g. read-only Docker containers). 187 Best used with opcache.validate_timestamps=0, 188 opcache.enable_file_override=1, 189 and opcache.file_cache_consistency_checks=0. 190 Note: A cache generated with a different build of PHP, a different file 191 path, or different settings (including which extensions are loaded), may be 192 ignored. 193 194======================================== 19512. Windows Support 196======================================== 197 198* The configuration variables PHP_VERSION, PHP_MINOR_VERSION, and 199 PHP_RELEASE_VERSION are now always numbers. Previously, they have been 200 strings for buildconf builds. 201 202* phpize builds now reflect the source tree in the build dir (like that already 203 worked for in-tree builds); some extension builds (especially when using 204 Makefile.frag.w32) may need adjustments. 205 206* --enable-sanitzer is now supported for MSVC builds. This enables ASan and 207 debug assertions, and is supported as of MSVC 16.10 and Windows 10. 208 209* COM: 210 . The extension is now build shared by default; previously it defaulted to a 211 static extension, although the official Windows binaries built a shared 212 extension. 213 214* FFI: 215 . It is no longer necessary to specify the library when using FFI::cdef() 216 and FFI::load(). However, this convenience feature should not be used in 217 production. 218 219* Streams: 220 . If only pipe streams are contained in the $read array, and the $write and 221 $except arrays are empty, stream_select() now behaves similar to POSIX 222 systems, i.e. the function only returns if at least one pipe is ready to be 223 read, or after the timeout expires. Previously, stream_select() returned 224 immediately, reporting all streams as ready to read. 225 226======================================== 22713. Other Changes 228======================================== 229 230- Core: 231 The high resolution timer (`hrtime()`) on macOS now uses the recommended 232 `clock_gettime_nsec_np(CLOCK_UPTIME_RAW)` API instead of 233 `mach_absolute_time()`. 234 235======================================== 23614. Performance Improvements 237======================================== 238 239- XMLWriter: 240 . Improved performance and reduce memory consumption. 241