Skip to content

Tempated function with variadic argment: Unable to resolve the template type TRest in call to function intersection #7704

Closed

Description

@bendavies

Bug report

Hi,

When the $rest argument is not given in the below code example. phpstan throws:

Unable to resolve the template type TRest in call to function intersection

This is valid PHP, but i'm not sure what PHPStan can do here, since there is no type provided by the caller.

Code snippet that reproduces the problem

https://phpstan.org/r/6e40c732-5e71-4c6b-8a60-db7be4deb506

Expected output

No errors

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

Every day it makes my life easier and saves me :)

Activity

  1. added this to the Generics milestone on Sep 21, 2022
  2. phpstan-bot commented on Mar 26, 2026

    @phpstan-bot
    Contributor

    Closed via merging phpstan/phpstan-src#5175

  3. github-actions commented on Apr 27, 2026

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

  4. locked as resolved and limited conversation to collaborators on Apr 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions