Thursday 26 March 2020

PHP 7.4 in Focal

The in-archive transition from PHP 7.3 to PHP 7.4 is complete. I expect
PHP 7.3 will be removed from Focal soon.

PHP 7.4 is a new feature update, bringing typed properties, arrow
functions, weak references, and unpacking inside arrays among other
things. For more information on the new features and improvements, see
the PHP 7.4 Release Announcement[0].

Deprecated features include:

- Nested ternary operations must explicitly use parentheses to dictate
the order of the operations. Previously, when used without
parentheses, the left-associativity would not result in the expected
behaviour in most cases.

- The array and string offset access syntax using curly braces is
deprecated. Use $var[$idx] instead of $var{$idx}.

- The (real) cast is deprecated, use (float) instead.

- The is_real() function is also deprecated, use is_float() instead.

- Unbinding $this of a non-static closure that uses $this is deprecated.

- Using parent inside a class without a parent is deprecated.

- The allow_url_include ini directive is deprecated.

- Passing invalid characters to base_convert(), bindec(), octdec() and
hexdec() will now generate a deprecation notice.

- Using array_key_exists() on objects is deprecated.

- The following functions are deprecated:
+ get_magic_quotes_gpc()
+ get_magic_quotes_runtime()
+ hebrevc()
+ convert_cyr_string()
+ money_format()
+ ezmlm_hash()
+ restore_include_path()

For more details about deprecated functionality, and suggested
replacements, see the PHP 7.4 Deprecated Features page[1].

Migration guides to 7.4 from 7.3[2] or earlier versions of PHP are also
available in the PHP Manual.

Users coming from Ubuntu 18.04 will be moving from 7.2 to 7.4, so should
also refer to the Migration guides to 7.3 from 7.2[3]

Note as well that phpunit has been undergoing a transition from 7.5.6 to
8.5.2, which changes behavior for functionality used in some test cases.

Bryce

0: https://www.php.net/releases/7_4_0.php
1: https://www.php.net/manual/en/migration74.deprecated.php
2: https://www.php.net/manual/en/migration74.php
3: https://www.php.net/manual/en/migration73.php