1.2.906. 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.906.1. Connex PHP features¶
1.2.906.1.1. Suggestions¶
Move the current classes with the same names into a distinct domain name
Change the name of the class
1.2.906.1.2. Specs¶
Short name |
Php/Php70NewClasses |
Rulesets |
All, Changed Behavior, 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 |
Available in |