Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to configure the version of PHP language in PhpStorm

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

PhpStorm how to configure the version of PHP language, many novices are not very clear about this, in order to help you solve this problem, the following editor will explain for you in detail, people with this need can come to learn, I hope you can gain something.

Problem description

Generally speaking, the default version of the PHP language in PhpStorm is PHP 5.4, with which PhpStorm automatically validates the files in the editor.

If we use the new feature of PHP 7.0in the PHP file (such as the null merge operator), then, because the new feature is not recognized when PhpStorm verifies the file, a warning flag (red wavy line) will be displayed in the corresponding location.

Although this won't have a big impact on our use of PhpStorm, the red alert just doesn't look good.

Solution method

Modify the configuration of PhpStorm to adjust the version of the PHP language to PHP 7.0.

Click the menu bar File → Settings → Languages & Frameworks → PHP, modify the value at the PHP language level drop-down list to 7, and click OK to save.

Introduction to PhpStorm:

PhpStorm is a commercial PHP integrated development tool developed by JetBrains, which aims to improve user efficiency, deeply understand users' code, provide intelligent code completion, fast navigation and real-time error checking. PhpStorm can help users adjust their code, run unit tests or provide visual debug functions at any time.

PhpStorm is written in Java. Users can extend IDE by installing plug-ins created for PhpStorm or by writing their own plug-ins. The software also communicates with external sources such as XDebug.

All the features available in WebStorm are included in PhpStorm, adding support for PHP and databases. WebStorm comes with a pre-installed JavaScript plug-in (such as Node.js).

Features:

PhpStorm provides PHP with a rich code editor [9] with syntax highlighting, extended code format configuration, instant error checking and code completion.

PHP 5.3,5.4,5.5,5.6,7.0,7.1,7.2,7.3,7.4,8.0 support, including generators, coroutines, finally keywords, lists in foreach, using empty () and other expressions on function call results, characteristics, closures, class member access when instantiated, short array syntax, array dereferencing when function calls, binary text, expressions in static calls It supports return type and scalar type hints as well as constant visibility. It can be used for both modern and legacy PHP-based projects.

The code automatically finalizes the class, method, variable name, and PHP keyword, as well as the common names of fields and variables, depending on their type.

Coding style support (PSR1/PSR2, Drupal, [10] Symfony, Zend).

PHPDoc support. IDE provides code completion recommendations based on @ property, @ method, and @ var comments.

Repeat code detector.

PHP code sniffer (phpcs), which can instantly check for code odor.

Refactoring (renaming, introducing variables, introducing constants, introducing fields, inline variables, moving static members, extracting interfaces).

Smarty and Twig template editing (syntax errors highlighted; Smarty functions and attributes completed; pairs of braces, quotation marks, and closing tags automatically inserted; and so on).

MVC view of Symfony and Yii frames.

PHAR support.

Is it helpful for you to read the above content? If you want to know more about the relevant knowledge or read more related articles, please follow the industry information channel, thank you for your support.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report