Skip to content

Commit

Permalink
Add test for null init
Browse files Browse the repository at this point in the history
  • Loading branch information
muglug committed Jul 7, 2019
1 parent 30ecde2 commit 820eba1
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tests/TryCatchTest.php
Expand Up @@ -230,6 +230,22 @@ function example() : void {
$lastException = $e; $lastException = $e;
} }
echo $lastException->getMessage();'
],
'varSetInOnlyCatchWithNull' => [
'<?php
$lastException = null;
try {
if (rand(0, 1)) {
throw new \Exception("Gotcha!");
}
exit;
} catch (\Exception $e) {
$lastException = $e;
}
echo $lastException->getMessage();' echo $lastException->getMessage();'
], ],
]; ];
Expand Down

0 comments on commit 820eba1

Please sign in to comment.