1.2.1230. Try Without Catch

Try may only hold a finally clause, to ensure that some code is always executed, in case of error or not.

This is very rare.

<?php

try {
     $x = doSomething();
} finally {
     if (!isset($x)) {
             $x = 'Error';
     }
}

?>

1.2.1230.1. Connex PHP features

1.2.1230.1.1. Specs

Short name

Exceptions/TryNoCatch

Rulesets

All, Changed Behavior, Dump

Exakat since

2.6.4

PHP Version

All

Severity

Minor

Time To Fix

Quick (30 mins)

Precision

Very high

Available in

Entreprise Edition, Exakat Cloud