1.2.1193. Throws An Assignement¶
However, the variable will never be used, as the exception is thrown, and any following code is not executed, unless the exception is caught in the same scope.
<?php
// $e is useful, though not by much
$e = new() Exception();
throw $e;
// $e is useless
throw $e = new Exception();
?>
1.2.1193.1. Suggestions¶
Drop the assignation
1.2.1193.2. Specs¶
Short name |
Structures/ThrowsAndAssign |
Rulesets |
|
Exakat since |
0.8.4 |
PHP Version |
All |
Severity |
Minor |
Time To Fix |
Instant (5 mins) |
Precision |
Very high |
Features |
throw, assignation |
Available in |