Skip to content

Conversation

mvs3d
Copy link

@mvs3d mvs3d commented Sep 29, 2025

The current stub for round() in standard/standard_3.php defines $mode twice, which causes inspections in PhpStorm to report "Function has a parameter whose default value is incompatible with its declared type".

The current stub for `round()` in `standard/standard_3.php` defines `$mode`
twice, which causes inspections in PhpStorm to report
"Function has a parameter whose default value is incompatible with its declared type".
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

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants