Skip to content

Support literal-string as an array key type #7353

@b1rdex

Description

@b1rdex

Feature request

phpstan.org/r/23576b4c-e502-4c2b-a308-41efc1af22a1

<?php declare(strict_types = 1);

class HelloWorld
{
	/** @param array<literal-string, mixed> $data */
	public function sayHello(array $data): void
	{
		\PHPStan\dumpType($data); // Dumped type: array<string, mixed>
	}
}

Did PHPStan help you today? Did it make you happy in any way?

💯

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions