# Syntax Coloring

PDT can automatically apply different colors and font attributes to different PHP syntax elements in order for your scripts to be more easily navigable and to help you find relevant sections quickly and easily. With the Syntax Coloring Rules you can set the foreground color, background color and font type for a range of different elements in your code through the Syntax Coloring Preferences page. This allows for a quick assessment of your code with the different elements individually visible, making errors visually distinct and easier to detect.

Completing the relevant element will cause the required color and font settings to be applied to it.

The table below goes into further detail about the elements available for Syntax Coloring rules and their default settings.

Element Name | Element Description | Default Foreground Color | Default Font
--- | --- | --- | ---
Classes | A user defined type (class or interface). |  |
Constants | A variable with a value that cannot be altered during execution. |  | Italic
Deprecated members | An unused member which still appears while transitioning tonew members. | _ | Strikethrough
Fields | A reference to a class variable |  |
Functions | A reference to a function |  |
Heredoc | A Heredoc block representation of a string value. |  |
Internal classes | A Type that was declared by PHP. |  |
Internal constants | A constant that was declared by PHP. |  | Bold and Italic
Internal functions | A function that was declared by PHP. | _ |
Keyword | A keyword that was declared by PHP. |  | Bold
Methods | A reference to a method |  |
Multi-line comment | A comment that spans more than one line. ("* */") |  |
Normal | Any section that does not have any specific description that applies to it. |  |
Number | A number. |  |
Parameter variables | A variable used in a method which refers to arguments in the method. |  | Underline
PHP tags | The PHP start and end tag (<?php, ?>). |  |
PHPDoc | A standard for commenting PHP which allows you to insert annotations in your code. |  | Bold
PHPDoc comment | A readable annotation inserted into your code. |  |
Single-line comment | A comment that spans a single line. |  |
Static fields | A reference to a static field |  | Italic
Static methods | A reference to a static method | _ | Italic
String | A sequence of characters selected from a set, which representa string of data values. |  |
Superglobal variables | A reference to Superglobal variables such as $_GLOBALS |  | Bold
Task tag | A reference to reminders of actions, work to do, or any otheraction required. |  | Bold
Variable | A reference to a variable. |  |

#### Note:

All elements have a default Background of white. The color and font settings can be configured from the Syntax Coloring preferences page, accessed from Window | Preferences | PHP | Editor | Syntax Coloring.

#### Note:

Syntax Coloring will also be available for JavaScript elements if JavaScript support was enabled for the project. See Enabling JavaScript Support in PHP Projects for more information. To configure JavaScript Syntax Coloring preferences, go to Window | Preferences | JavaScript | Editor | Syntax Coloring.

#### Related Links:

- Syntax Coloring preferences