Semantic Analysis Preferences
The Semantic Analysis feature enables warning and error messages to be displayed when Zend Studio detects possible errors or problems in your script.
The Semantic Analysis Preferences page is accessed from Window | Preferences | PHP | Editor | Semantic Analysis Properties.
Semantic Analysis Preferences page
Enabling and Configuring Semantic Analysis for All Projects
|
|
|
To enable and configure Semantic Analysis for all projects:
To select a severity level for an event, click the arrow next to each header to display the possible options (if not displayed) and select the severity level from the drop-down list next to each option.
|
|
Compile Errors
Allows you to select the severity level (error, warning or ignore) for the following:
-
Duplicate PHP element declaration (in same file)
-
Duplicate PHP element declaration (in file hierarchy)
-
Class element visibility reduce
-
Unimplemented abstract methods
-
Abstract class field
- Reserved types (PHP 7)
- Multiple default cases in a switch (PHP 7)
Potential Programmer Problems
Allows you to select the severity level (error, warning or ignore) for the following:
-
Undefined local variable
-
Undefined function
-
Undefined field (slow check)
-
Undefined method (slow check)
-
Undefined class or interface
-
Assignment in condition (e.g. 'if (a = b)')
-
Assignment has no effect (e.g. 'a=a')
-
Bad escape sequence in string
- Unused use statement
- Undefined trait member
- Conflicted trait member
- Deprecated API (slow check)
Applying Semantic Analysis Preferences Setting to a Specific Project
|
|
|
To apply Semantic Analysis Preferences settings to a specific project only:
|
Note: Semantic Analysis settings can also be configured for an existing project by right-clicking the project in PHP Explorer view and selecting Properties | Semantic Analysis Properties. |