1.2.1196. Throw

List of thrown exceptions.

<?php
if ($divisor === 0) {
    // Throw native exception
    throw new DivisionByZeroError("Shouldn't divide by one");
}

if ($divisor === 1) {
    // Throw custom exception
    throw new DontDivideByOneException("Shouldn't divide by one");
}
?>

See also Exceptions.

1.2.1196.1. Connex PHP features

1.2.1196.1.1. Specs

Short name

Php/ThrowUsage

Rulesets

All, Appinfo, CE, Changed Behavior

Exakat since

0.8.4

PHP Version

All

Severity

Time To Fix

Precision

Very high

Available in

Entreprise Edition, Community Edition, Exakat Cloud