1.2.1037. Reserved Keywords In PHP 7

PHP reserved names for class/trait/interface. They won’t be available anymore in user space starting with PHP 7.

For example, string, float, false, true, null, resource,`… <https://www.php.net/manual/en/functions.arguments.php#functions.variable-arg-list>`_ are not acceptable as class name.

<?php

// This doesn't compile in PHP 7.0 and more recent
class null { }

?>

See also List of other reserved words.

1.2.1037.1. Suggestions

  • Avoid using PHP reserved keywords as names for structures such as class, functions, etc.

1.2.1037.2. Specs

Short name

Php/ReservedKeywords7

Rulesets

All, Changed Behavior, CompatibilityPHP70

Exakat since

0.8.4

PHP Version

With PHP 7.0 and older

Severity

Major

Time To Fix

Slow (1 hour)

Changed Behavior

PHP 7.0 - More

Precision

Very high

Features

class

Available in

Entreprise Edition, Exakat Cloud