Skip to content

Commit aa3101d

Browse files
Add test
1 parent 0a0f8b9 commit aa3101d

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

tests/PHPStan/Rules/Classes/InstantiationRuleTest.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -493,6 +493,11 @@ public function testPhpstanInternalClass(): void
493493
]);
494494
}
495495

496+
public function testBug9659(): void
497+
{
498+
$this->analyse([__DIR__ . '/data/bug-9659.php'], []);
499+
}
500+
496501
public function testBug10248(): void
497502
{
498503
$this->analyse([__DIR__ . '/data/bug-10248.php'], []);
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?php // lint >=8.0
2+
3+
namespace Bug9659;
4+
5+
class HelloWorld
6+
{
7+
/**
8+
* @param float|null $timeout
9+
*/
10+
public function __construct($timeout = null)
11+
{
12+
var_dump($timeout);
13+
}
14+
}
15+
16+
new HelloWorld(20); // working
17+
new HelloWorld(random_int(20, 80)); // broken

0 commit comments

Comments
 (0)