Skip to content
Permalink
Browse files

Add test for null init

  • Loading branch information...
muglug committed Jul 7, 2019
1 parent 30ecde2 commit 820eba1151f9b57741bf59ee490cd561649b5cb3
Showing with 16 additions and 0 deletions.
  1. +16 −0 tests/TryCatchTest.php
@@ -230,6 +230,22 @@ function example() : void {
$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();'
],
];

0 comments on commit 820eba1

Please sign in to comment.
You can’t perform that action at this time.