You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following code is deprecated in PHP 8.0 because the parameter with a default value is followed by a required parameter (see the Deprecated Features for PHP Core):
<?phpfunctiontest($a = [], $b) {}
This is not reported by the phpdd tool:
$ phpdd -t 8.0 test.php
Max file size set to: 1.000 MiB
File test.php
Analyzer has not detected any issues in your code.
Peak memory usage: 2.430 MB
BTW The php executable does report on this deprecation:
$ php test.php
PHP Deprecated: Optional parameter $a declared before required parameter $b is implicitly treated as a required parameter in /path/to/test.php on line 2
Deprecated: Optional parameter $a declared before required parameter $b is implicitly treated as a required parameter in /path/to/test.php on line 2
The text was updated successfully, but these errors were encountered:
aadmathijssen
changed the title
Missing PHP 8.0 detection for parameter with default values that is followed by a required parameter
Missing PHP 8.0 detection for parameter with a default value that is followed by a required parameter
Nov 30, 2022
Processing of PHP function declarations.
Allows phpdd to detect declaration of optional function
params before required params.
Required params must come before optional on PHP 8x.
The following code is deprecated in PHP 8.0 because the parameter with a default value is followed by a required parameter (see the Deprecated Features for PHP Core):
This is not reported by the
phpdd
tool:BTW The
php
executable does report on this deprecation:The text was updated successfully, but these errors were encountered: