1.2.319. Custom Constant Usage

The code is using constants that are not defined in PHP extensions or PHP itself. This may lead to a fatal error.

<?php

// display MY_CONSTANT : MY_CONSTANT is a user constant.
echo MY_CONSTANT;

// display PHP version : PHP_VERSION is a native PHP constant.
echo PHP_VERSION;

// MY_CONSTANT definition.
const MY_CONSTANT;

?>

See also PHP Constants.

1.2.319.1. Specs

Short name

Constants/CustomConstantUsage

Rulesets

All, CE, Changed Behavior

Exakat since

0.8.4

PHP Version

All

Severity

Time To Fix

Precision

Very high

Features

constant

Available in

Entreprise Edition, Community Edition, Exakat Cloud