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.

Buy this article as PDF

Express-Checkout as PDF
Price $2.95
(incl. VAT)

Buy ADMIN Magazine

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

  • Lua for Apache

    Lua is a small, lean, and fast scripting language – ideal for working with web servers. Version 2.4 of the Apache web server is the first to offer a matching module that has a few quirks – and pitfalls, if you dig more deeply.

  • Program from one source to many apps with Flutter
    Developing apps in the past for Android, iOS, the web browser, and the desktop meant having to write different versions of the code; however, that's no longer the case thanks to Google's Flutter framework.
  • Innovations in PowerShell 5
    Windows 10 brings an updated, fifth release of PowerShell that vastly simplifies the task of managing modules and software packages. The scripting language now also handles various formatted output from commands and selection lists.
  • The Lua scripting language
    The Lua scripting language is built in to a variety of programs. In this article, we provide an insight into the Lua cosmos.
  • The Lua Scripting Language

    Is this powerful but simple scripting language big enough for Big Data?

comments powered by Disqus
Subscribe to our ADMIN Newsletters
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs



Support Our Work

ADMIN content is made possible with support from readers like you. Please consider contributing when you've found an article to be beneficial.

Learn More”>
	</a>

<hr>		    
			</div>
		    		</div>

		<div class=