-
Notifications
You must be signed in to change notification settings - Fork 483
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Casting ArrayObject to array should not lead to array shape
- Loading branch information
1 parent
abbae6a
commit d38ed50
Showing
2 changed files
with
21 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?php // lint >= 8.0 | ||
|
||
namespace Bug12182; | ||
|
||
use ArrayObject; | ||
use function PHPStan\Testing\assertType; | ||
|
||
/** | ||
* @extends ArrayObject<int, string> | ||
*/ | ||
class HelloWorld extends ArrayObject | ||
{ | ||
public function __construct(private int $a = 42) { | ||
} | ||
} | ||
|
||
function (HelloWorld $hw): void { | ||
assertType('array', (array) $hw); | ||
}; |