xref: /php-src/UPGRADING (revision bf5e6c5f)
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  . SplFileObject::fwrite's parameter $length is now nullable. The default
61    value changed from 0 to null.
62
63========================================
642. New Features
65========================================
66
67- Core:
68  . Added support for Closures in constant expressions.
69    RFC: https://wiki.php.net/rfc/closures_in_const_expr
70
71- DOM:
72  . Added Dom\Element::$outerHTML.
73
74- XSL:
75  . The $namespace argument of XSLTProcessor::getParameter(),
76    XSLTProcessor::setParameter() and XSLTProcessor::removeParameter()
77    now actually works instead of being treated as empty.
78    This only works if the $name argument does not use Clark notation
79    and is not a QName because in those cases the namespace is taken
80    from the namespace href or prefix respectively.
81
82========================================
833. Changes in SAPI modules
84========================================
85
86- CLI:
87  . Trying to set a process title that is too long with cli_set_process_title()
88    will now fail instead of silently truncating the given title.
89
90========================================
914. Deprecated Functionality
92========================================
93
94- Hash:
95  The MHASH_* constants have been deprecated.  These have been overlooked
96  when the mhash*() function family has been deprecated per
97  https://wiki.php.net/rfc/deprecations_php_8_1#mhash_function_family
98
99========================================
1005. Changed Functions
101========================================
102
103- Zlib:
104  . The "use_include_path" argument for the
105    gzfile, gzopen and readgzfile functions had been changed
106    from int to boolean.
107
108- PCNTL:
109  . pcntl_exec() now has a formal return type of false.
110
111- PDO_PGSQL:
112  . PDO::pgsqlCopyFromArray also supports inputs as Iterable.
113  . Pdo\Pgsql::setAttribute and Pdo\Pgsql::prepare supports
114    PDO::ATTR_PREFETCH sets to 0 which set to lazy fetch mode.
115    In this mode, statements cannot be run parallely.
116
117- PGSQL:
118  . pg_copy_from also supports inputs as Iterable.
119
120- POSIX:
121  . posix_ttyname sets last_error to EBADF when encountering
122    an invalid file descriptor.
123  . posix_isatty raises an E_WARNING message when encountering
124    an invalid file descriptor.
125  . posix_fpathconf checks invalid file descriptors and sets
126    last_error to EBADF and raises an E_WARNING message.
127
128========================================
1296. New Functions
130========================================
131
132- Curl:
133  . curl_multi_get_handles() allows retrieving all CurlHandles current
134    attached to a CurlMultiHandle. This includes both handles added using
135    curl_multi_add_handle() and handles accepted by CURLMOPT_PUSHFUNCTION.
136
137- DOM:
138  . Added Dom\Element::insertAdjacentHTML().
139
140- PGSQL:
141  . pg_close_stmt offers an alternative way to close a prepared
142    statement from the DEALLOCATE sql command in that we can reuse
143    its name afterwards.
144
145- Reflection:
146  . ReflectionConstant::getFileName() was introduced.
147  . ReflectionConstant::getExtension() and
148    ReflectionConstant::getExtensionName() were introduced.
149
150========================================
1517. New Classes and Interfaces
152========================================
153
154========================================
1558. Removed Extensions and SAPIs
156========================================
157
158========================================
1599. Other Changes to Extensions
160========================================
161
162- Readline:
163  . The return types of readline_add_history(), readline_clear_history(), and
164    readline_callback_handler_install() have been changed to true, rather
165    than bool.
166
167========================================
16810. New Global Constants
169========================================
170
171- Core:
172  . PHP_BUILD_DATE.
173
174- POSIX:
175  . POSIX_SC_OPEN_MAX.
176
177- Sockets:
178  . IPPROTO_ICMP/IPPROTO_ICMPV6.
179  . TCP_FUNCTION_BLK (FreeBSD only).
180
181========================================
18211. Changes to INI File Handling
183========================================
184
185- Opcache:
186  . Added opcache.file_cache_read_only to support a read-only
187    opcache.file_cache directory, for use with read-only file systems
188    (e.g. read-only Docker containers).
189    Best used with opcache.validate_timestamps=0,
190    opcache.enable_file_override=1,
191    and opcache.file_cache_consistency_checks=0.
192    Note: A cache generated with a different build of PHP, a different file
193    path, or different settings (including which extensions are loaded), may be
194    ignored.
195
196========================================
19712. Windows Support
198========================================
199
200* The configuration variables PHP_VERSION, PHP_MINOR_VERSION, and
201  PHP_RELEASE_VERSION are now always numbers.  Previously, they have been
202  strings for buildconf builds.
203
204* phpize builds now reflect the source tree in the build dir (like that already
205  worked for in-tree builds); some extension builds (especially when using
206  Makefile.frag.w32) may need adjustments.
207
208* --enable-sanitzer is now supported for MSVC builds.  This enables ASan and
209  debug assertions, and is supported as of MSVC 16.10 and Windows 10.
210
211* COM:
212  . The extension is now build shared by default; previously it defaulted to a
213    static extension, although the official Windows binaries built a shared
214    extension.
215
216* FFI:
217  . It is no longer necessary to specify the library when using FFI::cdef()
218    and FFI::load(). However, this convenience feature should not be used in
219    production.
220
221* Streams:
222  . If only pipe streams are contained in the $read array, and the $write and
223    $except arrays are empty, stream_select() now behaves similar to POSIX
224    systems, i.e. the function only returns if at least one pipe is ready to be
225    read, or after the timeout expires.  Previously, stream_select() returned
226    immediately, reporting all streams as ready to read.
227
228========================================
22913. Other Changes
230========================================
231
232- Core:
233  The high resolution timer (`hrtime()`) on macOS now uses the recommended
234  `clock_gettime_nsec_np(CLOCK_UPTIME_RAW)` API instead of
235  `mach_absolute_time()`.
236
237========================================
23814. Performance Improvements
239========================================
240
241- XMLReader:
242  . Improved property access performance.
243
244- XMLWriter:
245  . Improved performance and reduce memory consumption.
246