Skip to content
Advertisement

What do #@+ and #@- in PHP comment blocks mean?

I’ve seen several PHP files where there are some special characters at the beginning of a doc block. It starts with /**#@+ some doc-text */ and ends with /**#@-*/.

What do these symbols mean?

I found that this seems to be used in various PHP frameworks (Zend, phpseclib, Magento) but couldn’t find an explanation.

Example:

/**#@+
 * Constants for keys of data array. Identical to the name of the getter in snake case
 */
const ID = 'id';
const CUSTOMER_ID = 'customer_id';
const REGION = 'region';
const REGION_ID = 'region_id';
const COUNTRY_ID = 'country_id';
const STREET = 'street';
const COMPANY = 'company';
const TELEPHONE = 'telephone';
const FAX = 'fax';
const POSTCODE = 'postcode';
const CITY = 'city';
const FIRSTNAME = 'firstname';
const LASTNAME = 'lastname';
const MIDDLENAME = 'middlename';
const PREFIX = 'prefix';
const SUFFIX = 'suffix';
const VAT_ID = 'vat_id';
const DEFAULT_BILLING = 'default_billing';
const DEFAULT_SHIPPING = 'default_shipping';
/**#@-*/

Advertisement

Answer

They are used for DocBlock templates (see Wikipedia).

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement