Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion standard/standard_3.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ function floor(int|float $num) {}
function round(
int|float $num,
int $precision = 0,
#[PhpStormStubsElementAvailable(from: '5.3', to: '8.4')] #[LanguageLevelTypeAware(['8.4' => 'RoundingMode|int'], default: 'int')] $mode = 0,
#[PhpStormStubsElementAvailable(from: '5.3', to: '8.3')] #[LanguageLevelTypeAware(['8.4' => 'RoundingMode|int'], default: 'int')] $mode = 0,
Copy link
Contributor

Choose a reason for hiding this comment

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

This change is incorrect.

You have one $mode defined from 5.3 to 8.4
and one $mode defined from 8.5

It shouldn't overlap.

By changing the 8.4 to 8.3

  • There is no mode defined in 8.4
  • There is a conflict between PhpStormStubsElementAvailable (from 5.3 to 8.3) and the LanguageLevelTypeAware (8.4) which have no php version in common

Copy link
Contributor

Choose a reason for hiding this comment

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

@VincentLanglet Is completely correct. This change is invalid. Speaking about original problem with which causes inspections in PhpStorm to report "Function has a parameter whose default value is incompatible with its declared type". It was caused by previous version of this stub that had only one $mode definition. And the current version of stub aimed to fix exactly this issue. The problem originally reported in ticket https://youtrack.jetbrains.com/issue/WI-82556. Please check if you are using the latest PhpStorm version (2025.2.3)

#[PhpStormStubsElementAvailable(from: '8.5')] RoundingMode|int $mode = \RoundingMode::HalfAwayFromZero
): float {}

Expand Down