1.2.226. Constant Definition

List of class constants being defined.

<?php

// traditional way of making constants
define('aConstant', 1);

// modern way of making constants
const anotherConstant = 2;

class foo {
    // Not a constant, a class constant.
    const aClassConstant = 3;
}

?>

See also PHP Constants and PHP OOP Constants.

1.2.226.1. Specs

Short name

Classes/ConstantDefinition

Rulesets

All, Appinfo, CE

Exakat since

0.8.4

PHP Version

All

Severity

Time To Fix

Precision

Very high

Features

class, class-constant

Available in

Entreprise Edition, Community Edition, Exakat Cloud