Closed as not planned
Closed as not planned
Description
Description
The following code:
<?php
define('MY_CONST', false);
function constantExpressionInDefault( int $a = MY_CONST ? 10 : NULL) {}
Resulted in this output:
But I expected this output instead:
Deprecated: Implicitly marking parameter $paramA as nullable is deprecated, the explicit nullable type must be used instead in ... on line 3
Demo:
Context
I was doing some experimenting with the new deprecation as introduced in #12959 for the PHPCompatibility sniff to detect this via static analysis.
Not sure if this behaviour is intentional or a bug, but I figured I should flag it, so you all could have a look at it and take a decision on what should be done with parameters declared like the above example.
/cc @kocsismate @Girgias
PHP Version
master
Operating System
N/A