Skip to content

PHPDoc block is ignored for closures/anonymous functions #3770

@szepeviktor

Description

@szepeviktor

Bug report

spl_autoload_register(
    /**
     * @param class-string $class_name The fully-qualified class name.
     * @return void
     */
    static function ($class_name) {
Parameter #1 $autoload_function of function spl_autoload_register expects callable(string): void, Closure(mixed): mixed given.

Code snippet that reproduces the problem

https://phpstan.org/r/56909d36-0d70-4c8d-990a-be01e822c572

Expected output

No error.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions