« Previous 1 2 3 Next »
New features in PHP 7.3
Prime Numbers
Bartering
To compare two strings, many developers convert their content to uppercase or lowercase, for which the extension for multibyte strings has several functions. For example, mb_strtoupper("Street");
returns the text STREET
.
Special characters (e.g., the German Eszett) can sometimes cause problems, especially when compared. In addition to case mapping, case folding can occur, in which individual letters are replaced with other letters or even with a string of characters. In the case of the German Eszett, Straße would thus mutate to STRASSE .
In the current PHP version, all multibyte string functions such as mb_strtoupper()
provide full support for case mapping and case folding. The conversion methods can be applied to a string with mb_convert_case()
.
Functions like mb_strtoupper()
that eliminate upper and lower case, or just ignore it, now use the case folding method; for example, mb_strtoupper("Straße");
now returns STRASSE
. As in this example, the string length can change.
In the background, all multibyte string functions use the new Unicode 11.0.0. PHP 7.3 now correctly supports multibyte strings that occupy more than 2GB of memory. Finally, the PHP authors have improved the performance of the Multibyte String extension. In particular, the functions that convert upper- and lowercase letters should now work far faster.
New Regulator
The popular PCRE extension allows the evaluation of Perl-compatible regular expressions. PHP 7.3 has removed the legacy PCRE and added its successor PCRE2, which partly changes the behavior when evaluating rules. PCRE2 interprets character ranges in (character) classes far more strictly than its predecessor. PHP developers will notice this especially with invalid patterns. Furthermore, PCRE2 is based on Unicode version 10.0 instead of Unicode 7.0. In PHP 7.3, the preg_quote()
function now also masks the #
character.
If you run an LDAP server, you have good reason to celebrate: The new PHP also supports LDAP controls. These objects can be used by all query functions, including ldap_add()
and ldap_search()
. Additionally, ldap_parse_result()
in the $serverctrls
parameter reads controls from a server.
PHP 7.3 supports the new JSON_THROW_ON_ERROR
flag, which changes the error handling of json_decode()
and json_encode()
. Thanks to the new flag, the two functions from the JSON extension throw an exception when an error occurs.
Logger
The FastCGI Process Manager (FPM) now evaluates three additional settings for superior logging control. The global log_limit
setting determines the maximum number of characters in a line the log lists. As of late, this can be more than 1,024 characters.
The global log_buffering
setting enables logging without additional buffering, although the procedure is still considered experimental. Finally, the new pool option decorate_workers_output
disables the output decoration of the worker output when catch_workers_output
is enabled.
« Previous 1 2 3 Next »
Buy this article as PDF
(incl. VAT)