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 membersAn unused member which still appears while transitioning tonew members._ Strikethrough
Fields A reference to a class variable field.png
Functions A reference to a function function.png
Heredoc A Heredoc block representation of a string value. heredoc.png
Internal classes A Type that was declared by PHP.
Internal constants A constant that was declared by PHP. Bold and Italic
Internal functionsA 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 methodsA reference to a static method_ Italic
StringA sequence of characters selected from a set, which representa string of data values.
Superglobal variablesA reference to Superglobal variables such as $_GLOBALSBold
Task tagA reference to reminders of actions, work to do, or any otheraction required.Bold
VariableA 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.