Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Added regression test
  • Loading branch information
staabm committed May 13, 2026
commit 0335c70f991f02d585900bd6245f42d42ba9891c
Original file line number Diff line number Diff line change
Expand Up @@ -792,4 +792,11 @@ public function testBug5952(): void
]);
}

#[RequiresPhp('>= 8.3.0')]
public function testBug14569(): void
{
$this->analyse([__DIR__ . '/data/bug-14569.php'], []);
}


}
14 changes: 14 additions & 0 deletions tests/PHPStan/Rules/Exceptions/data/bug-14569.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php

namespace Bug14569;

use DateInterval;
use DateMalformedIntervalStringException;
use DateMalformedStringException;

try {
DateInterval::createFromDateString('FAIL');
} catch (DateMalformedIntervalStringException $e) {
var_dump($e::class);
var_dump($e instanceof DateMalformedStringException);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line feels weird in the regression test since its always false

Maybe better to not have it to avoid confusing people ?

}