![]() ![]() Should everything be declared as final by default in PHP? Let us know what you think in the comments! Rand function arguments in reverse order WI-64297 ![]() ![]() This is why PhpStorm allows you to add a final modificator to constants that are not inherited (just use Alt+Enter). Starting with PHP 8.1, it is possible to declare constants as final. Use the Alt+Enter quick-fix to update the property declaration. Private properties with read-only access inside a class could be declared with the readonly flag. Property can be declared readonly WI-63995 PhpStorm will not highlight pow() usages, but it will show you a handy quick-fix (Alt+Enter) to replace the old pow() calls with the ** operator. PHP has had an exponentiation operator ** available since version 5.6. ![]() PhpStorm will warn you about the redundant count() call. To append an item to an array, there is no need to explicitly specify the index. Usage of count($array) as array index WI-63865 That could lead to confusion and bugs, so PhpStorm will highlight such cases. The latter will not override the value if the key is duplicated. The behavior of array_merge() and merging with the + operator is different in PHP. Let’s take a look at some notable new inspections we’re adding in v2022.1. If you find some inspection is irrelevant to you, you can disable it simply by pressing Alt+Enter on the highlighted code and choosing Disable inspection under the inspection name. You can manage and configure inspections under Preferences | Editor | Inspections. With each release, we add many new inspections to help you prevent bugs in your code in the early development stages, before you commit it. Last week we launched the Early Access Program for PhpStorm 2022.1, and we are going to be releasing updates every week for the next two months. ![]()
0 Comments
Leave a Reply. |