From: Nikita Popov Date: Fri, 24 May 2019 08:58:33 +0000 (+0200) Subject: Add UPGRADING/NEWS entries X-Git-Tag: php-7.4.0alpha1~197 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=32f87bb575fc147dea57770d5f175831b8662141;p=php Add UPGRADING/NEWS entries --- diff --git a/NEWS b/NEWS index 4ce8b5dca5..b9553f1549 100644 --- a/NEWS +++ b/NEWS @@ -17,6 +17,8 @@ PHP NEWS (Nikita) . Implemented FR #62397 (disable_functions does not work with eval). (Benjamin Eberlei). + . Fixed bug #76451 (Aliases during inheritance type checks affected by + opcache). (Nikita) - CLI: . The built-in CLI server now reports the request method in log files. diff --git a/UPGRADING b/UPGRADING index 91f26e9a07..20a0348bad 100644 --- a/UPGRADING +++ b/UPGRADING @@ -27,16 +27,6 @@ PHP 7.4 UPGRADE NOTES . "fn" is now a reserved keyword. In particular it can no longer be used as a function or class name. It can still be used as a method or class constant name. - . Nesting ternary operators without explicit parentheses is deprecated: - - // Code like - $a ? $b : $c ? $d : $e - // should be replaced by (current interpretation) - ($a ? $b : $c) ? $d : $e - // or (likely intended interpretation) - $a ? $b : ($c ? $d : $e) - - RFC: https://wiki.php.net/rfc/ternary_associativity . Passing the result of a (non-reference) list() assignment by reference is consistently disallowed now. Previously this worked if the right hand side was a simple (CV) variable and did not occur as part of the list(). @@ -160,6 +150,22 @@ PHP 7.4 UPGRADE NOTES RFC: https://wiki.php.net/rfc/arrow_functions_v2 + . Added support for limited return type covariance and argument type + contravariance. The following code will now work: + + class A {} + class B extends A {} + + class Producer { + public function method(): A {} + } + class ChildProducer extends Producer { + public function method(): B {} + } + + This feature is currently restricted to non-cyclic type references only. + RFC: https://wiki.php.net/rfc/covariant-returns-and-contravariant-parameters + . Added support for coalesce assign (??=) operator. For example: $array['key'] ??= computeDefault(); @@ -262,10 +268,23 @@ PHP 7.4 UPGRADE NOTES ======================================== - Core: + . Nesting ternary operators without explicit parentheses is deprecated: + + // Code like + $a ? $b : $c ? $d : $e + // should be replaced by (current interpretation) + ($a ? $b : $c) ? $d : $e + // or (likely intended interpretation) + $a ? $b : ($c ? $d : $e) + + RFC: https://wiki.php.net/rfc/ternary_associativity . Unbinding $this of a non-static method through a combination of ReflectionMethod::getClosure() and closure rebinding is deprecated. Doing so is equivalent to calling a non-static method statically, which has been deprecated since PHP 7.0. + . Using "parent" inside a class without parent is deprecated, and will throw + a compile-time error in the future. Currently an error will only be + generated if/when the parent is accessed at run-time. - COM: . Importing type libraries with case-insensitive constant registering has been