Skip to content

Tag reference

@language

The @language tag injects a foreign-language grammar — SQL, HTML, regular expressions, and the like — into a string literal, so PhpStorm can apply the right syntax highlighting and completion inside it.

Grammar

"@language" <Name> [ <Description> ]

Examples

Highlighting the SQL inside a string.
/**
* @language SQL
*/
$query = 'SELECT id, name FROM users WHERE active = 1';

Names by platform

phpstorm
@language

Parsing a @language tag produces a LanguageTag instance, carrying the parsed $identifier alongside the $name and optional $description every Tag already provides.

final class LanguageTag extends IdentifierTag {}

Associated with PhpStorm; no dedicated JetBrains page documenting this exact doc-comment tag could be confirmed.