PHP

CodeLobster IDE comes with full-fledged support for PHP: great code assistance, smart debugger, all major PHP frameworks support. It represents the following abilities to work with PHP code:

PHP syntax highlighting

CodeLobster IDE supports PHP syntax highlighting in the Editor to make it easier to read the semantics of the structured content by displaying each type of code in different colors and fonts. This feature helps you to check code for errors, as it highlights mismatched enclosing characters with a different color.

[Tip]Tip

To change the color scheme or customize the colors or styles used for the PHP syntax highlighting, follow these steps:

  1. Open the Preferences dialog box (Tools | Preferences).

  2. Go to Editor | Colors

  3. In the Show settings for: component select PHP item and customize the colors or styles using the selectors to the right of the pane.

Pair braces highlighting

The Editor highlights pairs of:

  1. enclosing square brackets

  2. braces

  3. parenthesis ( () or () )

When the caret is placed between the beginning and ending enclosing characters. Mismatched enclosing characters are highlighted with a different color that you can change in the Preferences menu:

PHP navigation with holding Ctrl button

Ctrl + Click is a shortcut for mouse users to quickly access Go To Definition. Symbols become clickable when you press Ctrl and hover over the type or member.

To quickly navigate to the definition of a symbol, press the Ctrl key and then click on it.

Intelligent PHP autocomplete

The Intellisense autocomplete feature helps write code faster. PHP autocomplete feature makes code writing faster. Pop-up completion list includes:

  1. Both standard PHP and user's constants, variables.

  2. Functions

  3. Classes names

  4. Classes variables and functions

It is invoked automatically in the relevant area of code and lists possible names and syntax for completion.

[Tip]Tip

If you place caret behind the incomplete name of a function and there's only one choice for completing in the list, it won't appear, but the function name will be completed automatically. For example, place caret after "e" symbol in the following string ove

Now press Ctrl + Space, no list will appear, but the string will turn to: overload.

PHP function info

The Parameter Info popup shows the names of parameters in method and function calls. You can review a brief description of any PHP function and its parameters. CodeLobster automatically shows a popup when you place the mouse pointer on the target function name or parameter.

[Note]Note

Parameter Info works supports only PHP, JavaScript, and TypeScript.

You can explicitly invoke the popup if it has closed, select View | Intellisense | Parameter Info or press Ctrl + Shift + Space.

Default shortcut: Ctrl + Shift + Space

Option 1:

  1. Place mouse pointer on the target function name or parameter

Option 2:

  1. Place the caret on the target function name or parameter

  2. Open the Edit menu

  3. Choose the Intellisense | Parameter Info menu item

[Note]Note

Tooltips also appears when entering function parameters, and it highlights parameters separated by commas.

Commenting code

CodeLobster IDE comments the lines on depending on the syntax of the selected code (<! –– HTML ––>, /* CSS */, and so on).

  • To comment on a line of code, place the caret at the appropriate line and press Alt + C or select Edit | Comment line main menu item.

    Also, you can Comment Line by Line pressing Alt + X or select Edit | Comment lines by the line main menu item.

  • To uncomment selected fragment of code, use Alt + U shortcut or select Edit | Uncomment lines main menu item.

If you need to undo or redo your changes, press Ctrl + Z (Ctrl + Shift + Z) respectively.

[Note]Note

See more about Comment lines

Code collapsing

You can fold or unfold any manually selected regions in code. CodeLobster IDE folds or unfolds the current code fragment, for example, a single method. Folded code fragments are shown as a shaded box ( ).

To fold a code fragment:

  • Select Edit | Code Collapsing | Collapse Block (Ctrl + Num + -) main menu item or move the mouse over the gutter and click -.

To unfold a code fragment:

  • Select Edit | Code Collapsing | Collapse Block (Ctrl + Num + +) main menu item or move the cursor over the gutter and click +.

CodeLobster IDE collapses or expands all fragments within the selection, or, if nothing is selected, all fragments in the current file.

  • To collapse or expand all code fragments, select Edit | Code Collapsing | Collapse All Blocks main menu item (Ctrl + Shift + -) or Edit | Code Collapsing | Expand All Blocks (Ctrl + Shift + +) item.

When you hover cursor to folded fragment you see a code preview tooltip:

[Note]Note

See more about Code collapsing

Support for PHP in the Structure window

Structure window shows the general code structure of all PHP source files opens in the Editor. For each source file, the Structure window displays a tree of symbol nodes, including variables, functions, classes, and interfaces. Each node in the tree hierarchy can be expanded to display further detail, acting as an index to your source code.

PHP Context and Dynamic Help

The Dynamic Help window displays links to help topics for the target element. You can get the necessary information on any element of PHP code.

To get help topics using Dynamic Help:

  • Place the pointer on the target element and press the F1 button.

  • Select Help | Context Help main menu item.

  • Click the topic item in the Dynamic Help window.

    [Tip]Tip

    To show Dynamic Help select View | Panels | Dynamic Help main menu item.

By default, IDE conducts search through English PHP Manual on the https://www.php.net/ site.

You can change dynamic help language or specify local .chm help file to use:

  1. Select Tools | Preferences main menu item.

  2. On the left panel click Context Help item and select PHP

  3. If you want to change language, select it from the dropdown list.

  4. For using local .chm file, you need to mark the corresponding option and specify the path to it.