1.2.900. PHP 7.0 New Classes

Those classes are now declared natively in PHP 7.0 and should not be declared in custom code.

There are 8 new classes :

  • Error

  • ParseError

  • TypeError

  • ArithmeticError

  • DivisionByZeroError

  • ClosedGeneratorException

  • ReflectionGenerator

  • ReflectionType

  • AssertionError

<?php

namespace {
    // Global namespace
    class Error {
        // Move to a namespace
        // or, remove this class
    }
}

namespace B {
    class Error {
        // This is OK : in a namespace
    }
}

?>

See also New Classes and Interfaces.

1.2.900.1. Suggestions

  • Move the current classes with the same names into a distinct domain name

  • Change the name of the class

1.2.900.2. Specs

Short name

Php/Php70NewClasses

Rulesets

All, CompatibilityPHP53, CompatibilityPHP54, CompatibilityPHP55, CompatibilityPHP56

Exakat since

0.8.4

PHP Version

With PHP 7.0 and older

Severity

Major

Time To Fix

Slow (1 hour)

Precision

Very high

Features

class

Available in

Entreprise Edition, Exakat Cloud