Skip to content

Conversation

saundefined
Copy link
Member

@saundefined saundefined commented Sep 25, 2025

Copy link
Contributor

github-actions bot commented Sep 25, 2025

🚀 Regression report for commit 1abaefc is at https://web-php-regression-report-pr-1454.preview.thephp.foundation

Copy link
Contributor

github-actions bot commented Sep 25, 2025

🚀 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.',
Copy link
Member

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:

Suggested change
'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'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
private string $version = 'PHP 8.4'
public string $version = 'PHP 8.4',

Comment on lines +114 to +116
class PhpVersion {
public function __construct(
private readonly string $version = 'PHP 8.4'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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 {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
class PhpVersion {
final readonly class PhpVersion {

Comment on lines +101 to +102

var_dump(new PhpVersion()->withVersion('PHP 8.5'));
Copy link
Member

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).

Comment on lines +295 to +298
$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"
Copy link
Member

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) ?>
Copy link
Member

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) ?>
Copy link
Member

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) ?>
Copy link
Member

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) ?>
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants