-
Notifications
You must be signed in to change notification settings - Fork 581
[WIP] PHP 8.5 release page #1454
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
🚀 Regression report for commit 1abaefc is at https://web-php-regression-report-pr-1454.preview.thephp.foundation |
🚀 Preview for commit 1abaefc can be found at https://web-php-pr-1454.preview.thephp.foundation |
'common_header' => 'PHP 8.5 is a major update of the PHP language. It contains many new features, such as Pipe operator, Final Property Promotion, Attributes on Constants, performance improvements, bug fixes, and general cleanup.', | ||
'documentation' => 'Doc', | ||
'main_title' => 'Released!', | ||
'main_subtitle' => 'PHP 8.5 is a major update of the PHP language.<br class="display-none-md"> It contains many new features, such as Pipe operator, Final Property Promotion, Attributes on Constants, performance improvements, bug fixes, and general cleanup.', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This list should be kept in sync with the list of features below. So perhaps:
'main_subtitle' => 'PHP 8.5 is a major update of the PHP language.<br class="display-none-md"> It contains many new features, such as Pipe operator, Final Property Promotion, Attributes on Constants, performance improvements, bug fixes, and general cleanup.', | |
'main_subtitle' => 'PHP 8.5 is a major update of the PHP language.<br class="display-none-md"> It contains many new features, such as the new URI extension, support for modifying properties while cloning, the Pipe operator, performance improvements, bug fixes, and general cleanup.', |
<<<'PHP' | ||
class PhpVersion { | ||
public function __construct( | ||
private string $version = 'PHP 8.4' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
private string $version = 'PHP 8.4' | |
public string $version = 'PHP 8.4', |
class PhpVersion { | ||
public function __construct( | ||
private readonly string $version = 'PHP 8.4' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
class PhpVersion { | |
public function __construct( | |
private readonly string $version = 'PHP 8.4' | |
final readonly class PhpVersion { | |
public function __construct( | |
public string $version = 'PHP 8.4', |
Making this a full readonly
class is more explicit in what it can do for you: Modifying immutable classes.
<div class="php8-code phpcode"> | ||
<?php highlight_php_trimmed( | ||
<<<'PHP' | ||
class PhpVersion { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
class PhpVersion { | |
final readonly class PhpVersion { |
|
||
var_dump(new PhpVersion()->withVersion('PHP 8.5')); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will throw an error when the class is made readonly (which then should be indicated in the output).
$versions = ['PHP 8.1', 'PHP 8.2', 'PHP 8.3', 'PHP 8.4', 'PHP 8.5']; | ||
|
||
var_dump($versions[array_key_first($versions)]); | ||
// string(7) "PHP 8.1" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I find this example too simple to be useful, especially because $versions[0]
works for a list
. Perhaps we can find something with an associative array?
|
||
<div class="php8-compare"> | ||
<h2 class="php8-h2" id="final_promotion"> | ||
<?= message('final_promotion_title', $lang) ?> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it's worth listing it this prominently: There is not to explain or showcase there.
|
||
<div class="php8-compare"> | ||
<h2 class="php8-h2" id="attributes_on_constants"> | ||
<?= message('attributes_on_constants_title', $lang) ?> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similarly here: The main purpose of this is support for #[\Deprecated]
. I can't think of any other use case (and the RFC author couldn't either when asked). This is the expected syntax and already known from class constants.
|
||
<div class="php8-compare"> | ||
<h2 class="php8-h2" id="override_properties"> | ||
<?= message('override_properties_title', $lang) ?> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similarly here: Just mentioning “#[\Override]
now works on properties” is enough. It already got its spot in 8.3.
|
||
<div class="php8-compare"> | ||
<h2 class="php8-h2" id="static_aviz"> | ||
<?= message('static_aviz_title', $lang) ?> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same, but here aviz got a prominent spot in 8.4.
Preview: https://web-php-pr-1454.preview.thephp.foundation/releases/8.5/en.php