Skip to content

Commit

Permalink
add another test case
Browse files Browse the repository at this point in the history
  • Loading branch information
verfriemelt-dot-org committed Dec 14, 2022
1 parent 6536792 commit 04b11e0
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/PHPStan/Analyser/data/bug-8442.php
Expand Up @@ -8,5 +8,13 @@
function () {
assertType('false', DateInterval::createFromDateString('foo'));
assertType('DateInterval', DateInterval::createFromDateString('1 Day'));

if (rand(0,1)) {
$interval = 'P1Y';
} else {
$interval = 'P2Y';
}

assertType('DateInterval', DateInterval::createFromDateString($interval));
};

0 comments on commit 04b11e0

Please sign in to comment.