2021-08-31 17:13:49 +00:00
|
|
|
PHP 8.2 UPGRADE NOTES
|
2012-03-05 20:14:04 +00:00
|
|
|
|
|
|
|
1. Backward Incompatible Changes
|
|
|
|
2. New Features
|
2014-05-01 10:27:38 +00:00
|
|
|
3. Changes in SAPI modules
|
|
|
|
4. Deprecated Functionality
|
|
|
|
5. Changed Functions
|
|
|
|
6. New Functions
|
|
|
|
7. New Classes and Interfaces
|
2015-02-10 07:56:18 +00:00
|
|
|
8. Removed Extensions and SAPIs
|
2014-05-01 10:27:38 +00:00
|
|
|
9. Other Changes to Extensions
|
|
|
|
10. New Global Constants
|
|
|
|
11. Changes to INI File Handling
|
2014-08-22 11:35:07 +00:00
|
|
|
12. Windows Support
|
2019-01-28 09:34:31 +00:00
|
|
|
13. Other Changes
|
|
|
|
14. Performance Improvements
|
2010-03-24 16:23:50 +00:00
|
|
|
|
|
|
|
========================================
|
2012-03-05 20:14:04 +00:00
|
|
|
1. Backward Incompatible Changes
|
2010-03-24 16:23:50 +00:00
|
|
|
========================================
|
2016-04-24 21:49:52 +00:00
|
|
|
|
2022-05-13 10:13:48 +00:00
|
|
|
- Date:
|
|
|
|
. DateTime::createFromImmutable() now has a tentative return type of static,
|
2022-05-23 07:51:43 +00:00
|
|
|
previously it was DateTime.
|
2022-05-13 10:13:48 +00:00
|
|
|
. DateTimeImmutable::createFromMutable() now has a tentative return type of static,
|
2022-05-23 07:51:43 +00:00
|
|
|
previously it was DateTimeImmutable.
|
2022-05-13 10:13:48 +00:00
|
|
|
|
2022-04-22 15:04:47 +00:00
|
|
|
- ODBC:
|
|
|
|
. The ODBC extension now escapes the username and password for the case when
|
|
|
|
both a connection string and username/password are passed, and the string
|
|
|
|
must be appended to. Before, user values containing values needing escaping
|
|
|
|
could have created a malformed connection string, or injected values from
|
|
|
|
user-provided data. The escaping rules should be identical to the .NET BCL
|
|
|
|
DbConnectionOptions behaviour.
|
|
|
|
|
|
|
|
- PDO_ODBC:
|
|
|
|
. The PDO_ODBC extension also escapes the username and password when a
|
|
|
|
connection string is passed. See the change to the ODBC extension for
|
|
|
|
further details.
|
|
|
|
|
2021-12-15 13:38:35 +00:00
|
|
|
- Standard:
|
|
|
|
. strtolower() and strtoupper() are no longer locale-sensitive. They now
|
|
|
|
perform ASCII case conversion, as if the locale were "C". Use
|
|
|
|
mb_strtolower() if you want localized case conversion. Similarly, stristr,
|
|
|
|
stripos, strripos, lcfirst, ucfirst, ucwords, str_ireplace,
|
|
|
|
array_change_key_case and sorting with SORT_FLAG_CASE use ASCII case
|
|
|
|
conversion.
|
|
|
|
|
2022-04-08 16:58:10 +00:00
|
|
|
- SPL:
|
|
|
|
. The following methods now enforce their signature:
|
|
|
|
* SplFileInfo::_bad_state_ex()
|
|
|
|
* SplFileObject::getCsvControl()
|
|
|
|
* SplFileObject::fflush()
|
|
|
|
* SplFileObject::ftell()
|
|
|
|
* SplFileObject::fgetc()
|
|
|
|
* SplFileObject::fpassthru()
|
2022-04-20 16:43:10 +00:00
|
|
|
. SplFileObject::hasChildren() now has a tentative return type of false,
|
|
|
|
previously it was bool
|
|
|
|
. SplFileObject::getChildren() now has a tentative return type of null,
|
|
|
|
previously it was ?RecursiveIterator
|
2022-04-08 16:58:10 +00:00
|
|
|
|
2012-03-05 20:14:04 +00:00
|
|
|
========================================
|
|
|
|
2. New Features
|
|
|
|
========================================
|
2009-01-28 17:23:28 +00:00
|
|
|
|
2021-12-21 11:21:24 +00:00
|
|
|
- Core:
|
2022-04-08 09:00:28 +00:00
|
|
|
. Added the #[\SensitiveParameter] attribute to redact sensitive data in
|
2021-12-21 11:21:24 +00:00
|
|
|
backtraces.
|
|
|
|
RFC: https://wiki.php.net/rfc/redact_parameters_in_back_traces
|
2022-04-20 16:43:10 +00:00
|
|
|
. It is now possible to use null and false as standalone types.
|
|
|
|
RFC: https://wiki.php.net/rfc/null-false-standalone-types
|
2022-05-23 07:48:41 +00:00
|
|
|
. Added support for readonly classes.
|
|
|
|
RFC: https://wiki.php.net/rfc/readonly_classes
|
|
|
|
|
2021-12-21 11:21:24 +00:00
|
|
|
|
2021-10-19 21:20:16 +00:00
|
|
|
- Curl:
|
|
|
|
. Added CURLINFO_EFFECTIVE_METHOD option and returning the effective
|
|
|
|
HTTP method in curl_getinfo() return value.
|
|
|
|
|
2021-11-12 06:59:22 +00:00
|
|
|
- OCI8:
|
2021-11-28 01:06:25 +00:00
|
|
|
. Added an oci8.prefetch_lob_size directive and oci_set_prefetch_lob()
|
|
|
|
function to tune LOB query performance by reducing the number of
|
|
|
|
round-trips between PHP and Oracle Database when fetching LOBS. This is
|
|
|
|
usable with Oracle Database 12.2 or later.
|
2021-11-12 06:59:22 +00:00
|
|
|
|
2022-04-22 15:04:47 +00:00
|
|
|
- ODBC:
|
|
|
|
. Added odbc_connection_string_is_quoted, odbc_connection_string_should_quote,
|
|
|
|
and odbc_connection_string_quote. These are primarily used behind the scenes
|
|
|
|
in the ODBC and PDO_ODBC extensions, but is exposed to userland for easier
|
|
|
|
unit testing, and for user applications and libraries to perform quoting
|
|
|
|
themselves.
|
|
|
|
|
2021-10-15 15:03:26 +00:00
|
|
|
- PCRE:
|
|
|
|
. Added support for the "n" (NO_AUTO_CAPTURE) modifier, which makes simple
|
|
|
|
`(xyz)` groups non-capturing. Only named groups like `(?<name>xyz)` are
|
|
|
|
capturing. This only affects which groups are capturing, it is still
|
|
|
|
possible to use numbered subpattern references, and the matches array will
|
|
|
|
still contain numbered results.
|
|
|
|
|
2012-03-05 20:14:04 +00:00
|
|
|
========================================
|
2014-05-01 10:27:38 +00:00
|
|
|
3. Changes in SAPI modules
|
2012-03-05 20:14:04 +00:00
|
|
|
========================================
|
2009-01-28 17:23:28 +00:00
|
|
|
|
2012-03-05 20:14:04 +00:00
|
|
|
========================================
|
2014-05-01 10:27:38 +00:00
|
|
|
4. Deprecated Functionality
|
2012-03-05 20:14:04 +00:00
|
|
|
========================================
|
2009-01-28 17:23:28 +00:00
|
|
|
|
2021-09-01 14:54:17 +00:00
|
|
|
- Core:
|
2021-10-11 13:49:27 +00:00
|
|
|
. Creation of dynamic properties is deprecated, unless the class opts in by
|
|
|
|
using the #[AllowDynamicProperties] attribute. stdClass allows dynamic
|
|
|
|
properties. Usage of __get()/__set() is not affected by this change. A
|
|
|
|
dynamic properties deprecation warning can be addressed by:
|
|
|
|
- Declaring the property (preferred).
|
|
|
|
- Adding the #[AllowDynamicProperties] attribute to the class (which also
|
|
|
|
applies to all child classes).
|
|
|
|
- Using a WeakMap if you wish to associate additional data with an object
|
|
|
|
you do not own.
|
|
|
|
|
2021-09-01 14:54:17 +00:00
|
|
|
. Callables that are not accepted by the $callable() syntax (but are accepted
|
|
|
|
by call_user_func) are deprecated. In particular:
|
|
|
|
|
|
|
|
"self::method"
|
|
|
|
"parent::method"
|
|
|
|
"static::method"
|
|
|
|
["self", "method"]
|
|
|
|
["parent", "method"]
|
|
|
|
["static", "method"]
|
|
|
|
["Foo", "Bar::method"]
|
|
|
|
[new Foo, "Bar::method"]
|
|
|
|
|
|
|
|
This does not affect normal method callables like "A::method" or
|
|
|
|
["A", "method"]. A deprecation notice is only emitted on call. Both
|
|
|
|
is_callable() and the callable type will silently accept these callables
|
|
|
|
until support for them is removed entirely.
|
|
|
|
|
|
|
|
RFC: https://wiki.php.net/rfc/deprecate_partially_supported_callables
|
|
|
|
|
2022-03-12 11:44:19 +00:00
|
|
|
. The "${var}" and "${expr}" style string interpolations are deprecated and
|
2022-05-05 15:49:20 +00:00
|
|
|
will be removed in PHP 9. Use "$var"/"{$var}" or "{${expr}}", respectively.
|
2022-03-12 11:44:19 +00:00
|
|
|
RFC: https://wiki.php.net/rfc/deprecate_dollar_brace_string_interpolation
|
|
|
|
|
Deprecate use of mbstring to convert text to Base64/QPrint/HTML entities/etc
The purpose of mbstring is for working with Unicode and legacy text
encodings; but Base64, QPrint, etc. are not text encodings and don't
really belong in mbstring. PHP already contains separate implementations
of Base64, QPrint, and HTML entities. It will be better to eventually
remove these non-encodings from mbstring.
Regarding HTML entities... there is a bit more to say. mbstring's
implementation of HTML entities is different from the other built-in
implementation (htmlspecialchars and htmlentities). Those functions
convert <, >, and & to HTML entities, but mbstring does not.
It appears that the original author of mbstring intended for something
to be done with <, >, and &. He used a table to identify which
characters should be converted to HTML entities, and </>/& all have a
special value in that table. However, nothing ever checks for that
special value, so the characters are passed through unconverted.
This seems like a very useless implementation of HTML entities. The most
important characters which need to be expressed as entities in HTML
documents are those three!
2021-10-18 18:56:34 +00:00
|
|
|
- Mbstring:
|
|
|
|
. Use of QPrint, Base64, Uuencode, and HTML-ENTITIES 'text encodings' is
|
|
|
|
deprecated for all Mbstring functions. Unlike all the other text
|
|
|
|
encodings supported by Mbstring, these do not encode a sequence of
|
|
|
|
Unicode codepoints, but rather a sequence of raw bytes. It is not
|
|
|
|
clear what the correct return values for most Mbstring functions should
|
|
|
|
be when one of these non-encodings is specified. Further, PHP has
|
|
|
|
separate, built-in implementations of all of them; for example, UUencoded
|
|
|
|
data can be handled using convert_uuencode/convert_uudecode.
|
|
|
|
|
2012-03-05 20:14:04 +00:00
|
|
|
========================================
|
2014-05-01 10:27:38 +00:00
|
|
|
5. Changed Functions
|
2012-03-05 20:14:04 +00:00
|
|
|
========================================
|
2009-06-23 19:40:31 +00:00
|
|
|
|
2021-10-23 11:04:23 +00:00
|
|
|
- DBA
|
2021-11-06 23:09:40 +00:00
|
|
|
. dba_open() and dba_popen() now have the following enforced function signature
|
|
|
|
dba_open(string $path, string $mode, ?string $handler = null, int $permission = 0o644, int $map_size = 0)
|
2021-10-23 11:04:23 +00:00
|
|
|
. dba_fetch()'s optional skip argument is now at the end in line with
|
|
|
|
PHP userland semantics its signature now is:
|
|
|
|
dba_fetch(string|array $key, $dba, int $skip = 0): string|false
|
|
|
|
The overloaded signature
|
|
|
|
dba_fetch(string|array $key, $skip, $dba): string|false
|
|
|
|
is still accepted, but it is recommended to use the new standard variant.
|
|
|
|
|
2012-03-05 20:14:04 +00:00
|
|
|
========================================
|
2014-05-01 10:27:38 +00:00
|
|
|
6. New Functions
|
2012-03-05 20:14:04 +00:00
|
|
|
========================================
|
2015-04-24 15:19:58 +00:00
|
|
|
|
2022-05-05 13:51:20 +00:00
|
|
|
- Reflection:
|
|
|
|
. ReflectionFunction::isAnonymous()
|
2022-05-04 11:21:37 +00:00
|
|
|
. ReflectionMethod::hasPrototype()
|
2022-05-05 13:51:20 +00:00
|
|
|
|
2022-03-30 07:45:47 +00:00
|
|
|
- Sodium:
|
|
|
|
. sodium_crypto_stream_xchacha20_xor_ic()
|
|
|
|
|
2022-03-04 12:24:08 +00:00
|
|
|
- Standard:
|
|
|
|
. The peak memory usage can now be reset to the current usage thanks to
|
|
|
|
memory_reset_peak_usage().
|
|
|
|
|
2012-03-05 20:14:04 +00:00
|
|
|
========================================
|
2014-05-01 10:27:38 +00:00
|
|
|
7. New Classes and Interfaces
|
2012-03-05 20:14:04 +00:00
|
|
|
========================================
|
2009-01-28 17:23:28 +00:00
|
|
|
|
2012-03-05 20:14:04 +00:00
|
|
|
========================================
|
2015-02-10 07:56:18 +00:00
|
|
|
8. Removed Extensions and SAPIs
|
2012-03-05 20:14:04 +00:00
|
|
|
========================================
|
2009-01-28 17:23:28 +00:00
|
|
|
|
2012-03-05 20:14:04 +00:00
|
|
|
========================================
|
2014-05-01 10:27:38 +00:00
|
|
|
9. Other Changes to Extensions
|
2012-03-05 20:14:04 +00:00
|
|
|
========================================
|
2016-07-03 10:43:30 +00:00
|
|
|
|
2022-05-28 06:50:03 +00:00
|
|
|
- Date:
|
|
|
|
. DatePeriod properties are now properly declared.
|
|
|
|
|
2022-01-20 10:30:35 +00:00
|
|
|
- Intl:
|
|
|
|
. IntlBreakIterator, IntlRuleBasedBreakIterator, IntlCodePointBreakIterator,
|
|
|
|
IntlPartsIterator, IntlCalendar, IntlCalendar, Collator, IntlIterator,
|
|
|
|
UConverter, IntlDateFormatter, IntlDatePatternGenerator, MessageFormatter,
|
|
|
|
ResourceBundle, Spoofchecker, IntlTimeZone and Transliterator instances are
|
|
|
|
no longer serializable. Previously, they could be serialized, but
|
|
|
|
unserialization yielded unusable objects or failed.
|
|
|
|
|
2022-05-30 15:22:48 +00:00
|
|
|
- mysqli:
|
|
|
|
. The support for libmysql has been removed. It's no longer possible to compile
|
|
|
|
mysqli with libmysql and all relevant functionality has been removed.
|
|
|
|
. The reconnect property of mysqli_driver has been removed. It was supported only by libmysql.
|
|
|
|
. The INI directive mysqli.reconnect has been removed.
|
|
|
|
|
2021-12-12 02:32:34 +00:00
|
|
|
- OCI8:
|
|
|
|
. The minimum Oracle Client library version required is now 11.2.
|
|
|
|
|
2022-03-14 19:09:20 +00:00
|
|
|
- SQLite3:
|
|
|
|
. sqlite3.defensive is now PHP_INI_USER.
|
|
|
|
|
2021-12-15 19:00:24 +00:00
|
|
|
- Standard:
|
|
|
|
. getimagesize() now reports the actual image dimensions, bits and channels
|
|
|
|
of AVIF images. Previously, the dimensions have been reported as 0x0, and
|
|
|
|
bits and channels have not been reported at all.
|
|
|
|
|
2022-05-26 06:30:05 +00:00
|
|
|
- Tidy:
|
|
|
|
. tidy properties are now properly declared.
|
|
|
|
. tidyNode properties are now properly declared as readonly.
|
|
|
|
|
2021-10-05 14:27:03 +00:00
|
|
|
- Zip:
|
|
|
|
. extension updated to 1.20.0 with new methods:
|
2021-10-27 11:02:10 +00:00
|
|
|
ZipArchive::clearError, getStreamName and getStreamIndex
|
2021-10-05 14:27:03 +00:00
|
|
|
|
2012-03-05 20:14:04 +00:00
|
|
|
========================================
|
2014-05-01 10:27:38 +00:00
|
|
|
10. New Global Constants
|
2012-03-05 20:14:04 +00:00
|
|
|
========================================
|
2010-03-24 16:23:50 +00:00
|
|
|
|
2021-10-25 06:40:44 +00:00
|
|
|
- COM_DOTNET:
|
|
|
|
. LOCALE_NEUTRAL
|
|
|
|
|
2021-12-24 10:14:48 +00:00
|
|
|
- Curl:
|
|
|
|
. CURLOPT_XFERINFOFUNCTION
|
2022-05-15 11:01:50 +00:00
|
|
|
. CURLOPT_MAXFILESIZE_LARGE
|
2021-12-24 10:14:48 +00:00
|
|
|
|
2021-12-10 19:41:00 +00:00
|
|
|
- Sockets:
|
|
|
|
. SO_INCOMING_CPU
|
2022-05-21 10:12:09 +00:00
|
|
|
. SO_MEMINFO
|
2022-05-27 12:06:53 +00:00
|
|
|
. SO_RTABLE (OpenBSD)
|
|
|
|
. TCP_KEEPALIVE (MacOS)
|
|
|
|
. TCP_KEEPCNT (Linux, others)
|
|
|
|
. TCP_KEEPIDLE (Linux, others)
|
|
|
|
. TCP_KEEPINTVL (Linux, others)
|
|
|
|
. TCP_NOTSENT_LOWAT
|
2022-06-02 13:08:03 +00:00
|
|
|
. LOCAL_CREDS_PERSISTENT (FreeBSD)
|
|
|
|
. SCM_CREDS2 (FreeBSD)
|
2022-06-03 19:43:09 +00:00
|
|
|
. LOCAL_CREDS (NetBSD)
|
2021-12-10 19:41:00 +00:00
|
|
|
|
2012-03-05 20:14:04 +00:00
|
|
|
========================================
|
2014-05-01 10:27:38 +00:00
|
|
|
11. Changes to INI File Handling
|
2012-03-05 20:14:04 +00:00
|
|
|
========================================
|
2010-08-30 09:38:47 +00:00
|
|
|
|
2014-08-22 11:35:07 +00:00
|
|
|
========================================
|
|
|
|
12. Windows Support
|
|
|
|
========================================
|
|
|
|
|
2021-10-25 06:40:44 +00:00
|
|
|
- Core:
|
|
|
|
. Windows specific error messages are no longer localized, but instead in
|
|
|
|
English to better match PHP error messages.
|
|
|
|
|
2021-12-12 11:31:07 +00:00
|
|
|
- OCI8:
|
|
|
|
. Since building against Oracle Client 10g is no longer supported anyway,
|
|
|
|
the configuration option --with-oci8 has been dropped. --with-oci8-11g,
|
|
|
|
--with-oci8-12c and --with-oci8-19 are still supported.
|
|
|
|
|
2022-05-13 12:59:12 +00:00
|
|
|
- Zip:
|
|
|
|
. The Zip extension is now built as shared library (DLL) by default.
|
|
|
|
|
2019-01-15 09:13:39 +00:00
|
|
|
========================================
|
2019-01-28 09:34:31 +00:00
|
|
|
13. Other Changes
|
2012-03-05 20:14:04 +00:00
|
|
|
========================================
|
2018-12-26 21:26:01 +00:00
|
|
|
|
2022-06-07 12:48:47 +00:00
|
|
|
- Core:
|
|
|
|
. The iterable type is now a built-in compile time alias for array|Traversable.
|
|
|
|
Error messages relating to iterable will therefore now use array|Traversable.
|
|
|
|
Type Reflection is preserved for single iterable (and ?iterable) to produce
|
|
|
|
a ReflectionNamedType with name iterable, however usage of iterable in
|
|
|
|
union types will be converted to array|Traversable
|
|
|
|
|
2018-12-26 21:26:01 +00:00
|
|
|
========================================
|
2019-01-28 09:34:31 +00:00
|
|
|
14. Performance Improvements
|
2018-12-26 21:26:01 +00:00
|
|
|
========================================
|