diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2020-02-06 11:13:13 +0100 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2020-02-17 12:21:33 +0100 |
commit | 72bd55902d1908857f47555ad69458861e1acd94 (patch) | |
tree | 3e54bf617776657ae9a7ae9a8b357798dfab2cb0 /UPGRADING | |
parent | 43443857b74503246ee4ca25859b302ed0ebc078 (diff) | |
download | php-git-72bd55902d1908857f47555ad69458861e1acd94.tar.gz |
Improve generated names for anonymous classes
In order of preference, the generated name will be:
new class extends ParentClass {};
// -> ParentClass@anonymous
new class implements FirstInterface, SecondInterface {};
// -> FirstInterface@anonymous
new class {};
// -> class@anonymous
This is intended to display a more useful class name in error messages
and stack traces, and thus make debugging easier.
Closes GH-5153.
Diffstat (limited to 'UPGRADING')
-rw-r--r-- | UPGRADING | 13 |
1 files changed, 12 insertions, 1 deletions
@@ -130,6 +130,18 @@ PHP 8.0 UPGRADE NOTES exception. . Some "Only variables should be passed by reference" notices have been converted to "Cannot pass parameter by reference" exception. + . The generated name for anonymous classes has changed. It will now include + the name of the first parent or interface: + + new class extends ParentClass {}; + // -> ParentClass@anonymous + new class implements FirstInterface, SecondInterface {}; + // -> FirstInterface@anonymous + new class {}; + // -> class@anonymous + + The name shown above is still followed by a null byte and and a unique + suffix. - COM: . Removed the ability to import case-insensitive constants from type @@ -386,7 +398,6 @@ PHP 8.0 UPGRADE NOTES writing `Foo::BAR::$baz` is now allowed. RFC: https://wiki.php.net/rfc/variable_syntax_tweaks - - Date: . Added DateTime::createFromInterface() and DateTimeImmutable::createFromInterface(). |